This feature allows users to use helpers like pluck and join in workflows. The pluck helper extracts specific fields (e.g., product titles) from an array of objects, while the join helper combines these values into a single string with a custom separator. They are useful for automating the extraction and formatting of data between datasets.
Choose the trigger :
Start by setting up a workflow trigger, such as Order Form Submitted or Inbound webhook, or any trigger that has a data list - to start the workflow when an order is placed.
Set up an action :
Example: use the action "Create row in Google Sheets" to record customer and product details.
Customer name : Use {{ contact.first_name }}.
Email : Use {{ contact.email }}.
Products : Use the combined sequence created in the next step.
Add data processing logic :
Use the pluck helper to extract product titles from the line_items array of the order.
{{ pluck order.line_items "title" }}
Use the join helper to combine these titles into a single formatted sequence.
{{ join (pluck order.line_items "title") ", " }}Test and validate :
Before finalizing, run a test to ensure the workflow processes the data as expected. Use tools like Postman or live order submissions to confirm the correct output.
You want to record order details in a Google Sheet whenever a customer submits an order form. This record should include the customer's name, email, and a formatted list of purchased products.
Create workflow trigger :
Use the Order Form Submitted trigger to start the workflow.
Use Pluck and join helpers :
Extract product titles using the pluck helper
{{ pluck order.line_items "title" }}Format the titles using the join helper
{{ join (pluck order.line_items "title") ", " }}Add Google Sheets action :
Select the "Create row in Google Sheets" action.
Map the fields:
Name :{{ contact.first_name }}
Email :{{ contact.email }}
Products :{{ join (pluck order.line_items "title") ", " }}
Example of Google spreadsheet :
NameEmailProducts | ||
Alice | alice@test.com | TEST OFFER, ANOTHER PRODUCT |
Prumo | bob@test.com | SINGLE ITEM |
When using pluck and join helpers, you can efficiently extract and format product data for seamless workflow automation and integration. This feature saves time, reduces manual effort, and improves the usability of your workflows.