How to Pull Customer Product Details into Sparkforge Workflows
Pluck and join are workflow helpers in Sparkforge. Pluck extracts a field from an array of line items, and join concatenates the values—useful for logging product data to Google Sheets or external systems.
The pluck and join helpers in Sparkforge workflows pull product details out of order data and format them into a single string. They’re built for automating order logging, syncing product info to external systems, and updating spreadsheets like Google Sheets.
What Pluck and Join Do
- pluck: Extracts one field (for example,
title) from every object in an array. - join: Concatenates the resulting values into a single string with a separator you choose.
Together they turn a list of line items into a clean, human-readable summary you can drop into any custom field.
Step-by-Step
Step 1: Choose a Trigger
Use a trigger that exposes a list of line items—for example, Order Submitted or an Inbound Webhook carrying order data.
Step 2: Add an Action
For example, Create Row in Google Sheets. Map the fields you want to log:
- Customer Name:
{{ contact.first_name }} - Email:
{{ contact.email }} - Products: the formatted string from Step 3
Step 3: Add the Pluck and Join Logic
Extract the product titles:
{{ pluck order.line_items "title" }}Then combine them into one comma-separated string:
{{ join (pluck order.line_items "title") ", " }}Step 4: Test and Validate
Run a test order or send a sample webhook (Postman works well) to confirm the workflow produces the formatted string you expect.
Available Line-Item Fields
titleimagepricequantityline_subtotalline_discountline_pricemetaproduct_idprice_idorder_id/invoice_id
Examples:
{{ pluck payment.line_items "title" }}
{{ pluck payment.line_items "line_subtotal" }}
{{ pluck payment.line_items "meta.product_id" }}Replace the field name to pluck any other supported value.
Example: Log Orders to Google Sheets
Scenario
Every time a customer submits an order, log the customer’s name, email, and a comma-separated list of purchased products to a Google Sheet.
Steps
- Set the trigger to Order Submitted.
- Build the product string with pluck and join:
{{ join (pluck order.line_items "title") ", " }}. - Add a Create Row in Google Sheets action and map: Name =
{{ contact.first_name }}, Email ={{ contact.email }}, Products = the formatted string. - Submit a test order and confirm the row appears with the expected fields.
Example Output
| Name | Products | |
|---|---|---|
| Alice | alice@test.com | TEST OFFER, ANOTHER PRODUCT |
| Bob | bob@test.com | SINGLE ITEM |
Pluck and join keep order data flowing cleanly between Sparkforge and the rest of your stack—no manual exports, no copy-paste.
Frequently Asked Questions
Where can I use pluck and join?
What separator should join use?
Can I pluck nested fields?
Which triggers carry line items?
Was this article helpful?
Thanks for the feedback.