Available on plans:
Free
Pro
Team
Enterprise
Line items are individual items related to a category or header. For example, “apples, oranges, bananas” can be line items for the group “fruit.” This is used in e-commerce, for example, to represent different products in an order and their features.
Many apps require information formatted as line items to work properly. If the step where the data comes from does not support line items, you can use Formatter to reformat your data into line items.
For computers, line items must be represented as a type of JSON data structure, composed of a key and a comma-separated list inside of square brackets that looks like this:
{ fruit:
[ “apples”, “oranges”, “bananas” ]}
1. Add a Formatter Utilities step to your Zap
- In the Zap editor, click the Action step. A dialog box will open.
- In the search box, search for and select Formatter. The right sidebar will open to the Setup tab.
- Click the Action event dropdown menu and select Utilities.
- Click Continue.
2. Set up your transform
You can create line items with two different Formatter transforms: Text to Line-item, to create one set of line items, and Line Itemizer, to create multiple sets of line items.
Text to Line-item
If you have a single set of line items you want to create, use the Text to Line-item transform:
- Click the Transform dropdown menu and select Text to Line-item.
- Click the Input field and map data from another step that's formatted as comma-separated values (e.g., “apples,bananas,oranges”).
- Click Continue.
Line Itemizer
If you need to create more than one set of line items, use the Line Itemizer transform:
- Click the Transform dropdown menu and select Line Itemizer (Create/Append/Prepend).
- (Optional) In the Line-item(s) Group Name field, enter a name for your line item group.
- In the Line-item Properties section, add your line items:
- In the field on the left, enter a property name.
- In the field on the right, map a field from a previous step that has information formatted as comma-separated values.
- Repeat this step for each set of line items.
- Click Continue.
3. Test your line item transformation
- Click Test step. If the transformation is successful, the information from the trigger will be converted into line items.
Once you create line items with Formatter, you can use these line items in other actions in your Zap.