Line Items
Line Items helps to extract data values from an invoice or an ecommerce order then helps you to format the items lists in an order which can be used to send WhatsApp or SMS in a better way.

What is a Line Item?

Line items are generally multiple items combined into one item, the best example when you buy multiple 10 items from a supermarket they will provide you only one invoice instead of 10 separate invoices but each item in the single invoice have different price value, quantity and expiry date so an items in an invoice can be treated as a line item. For better understanding see the below image.

How it Works?

When an invoice or an ecommerce order contains multiple items in which the number of items for each transactions is not sure i.e first customer may have only 5 items where the next customer may have 10 items. Once the customer placed the order you want to send the item in details like Item Name, Quantity, Price, Offer, Tax etc as a WhatsApp Messages.
Line item formatter helps you to extract the values of each items in the order and send as a WhatsApp message, see the below example for a better understanding how it works,
This in an invoice line item contains 4 columns and 3 rows, this is ok to be sent via Email but not for WhatsApp or SMS
SL
Item Name
Quantity
Price
1
Onion
2
20
2
Carrot
3
10
3
Milk
5
30
Below is the formatted line item which can sent via WhatsApp or SMS
1, Onion x 2 = $20 2, Carrot x 3 = $10 3, Milk x 5 = $30 Total Items : 3
You have the option to customise the above format the way you needed, you will learn more how to customise the format in the below sections.

Setting Up Line Items

To setup line item go to Formatter -> Line Items as show below;

Select Field

You will see an option to "Select Field" as shown below on clicking this will open a popup which will only list the supported line items (array or objects)
Please note if you are not seeing any values here this means no line items is found the request received from the 3rd party app.
Once a line item is selected you will see options as shown in the below image;

Sample Value

Sample value shows the heading of the line items in the left side and sample values in the line items in the right side, which helps you to review it,
Kindly note only 3 values are fetched and shows as sample.

Delimiter

Delimiter helps you to separate each row to make it more visually appealing like it can separate one row with another with 5 spaces, 2 new lines or combining both like text & new line, once you setup the delimiter you will have an option to use it in the below section;

Customise the Format

This helps you to customise the outgoing message format the way you needed, you can type the message in the text area and use the attribute section to insert the line items into it.
Please note in the attribute only line item details will be show, no other attribute values can't be inserted from here.
You can see 3 Additional Attributes which is common for all the sections as shown below;
Auto Number Auto number means what is position of the item in the list like 1st, 2nd etc
Total Items This gives you the total row count i.e total items, suppose if an order contains 100 items then it shows as 100, useful when you limit the line items to certain number and want to inform your customer that Total Item is 100 i.e it will show the first 5 items in the message then you can put Total Items.
Delimiter When a delimiter attribute is added into the formatting section, the system will add the delimiter as configured by you. For an example if the delimiter configured by you is 2 new line space then the system will automatically add 2 new line space after end of every row data till it reaches the last row in the item
If you put any static value before the delimiter position then it will repeatedly show this, so if you want to put any static data like Total Items then always put this after inserting the delimiter attribute.
Sample Formatting
You can customise the message formatting the way you needed, few samples are shown below for better understanding This is an example of an order contains 3 line items
SL
Item Name
Quantity
Price
1
Onion
2
20
2
Carrot
3
10
3
Milk
5
30
Sample Formatting 1 SL : 1 Item Name : Onion Quantity : 2 Price : 20
SL : 2 Item Name : Carrot Quantity : 3 Price : 10
SL : 3 Item Name : Milk Quantity : 5 Price : 30
Total Items : 3
Sample Formatting 2
1, Onion x 2 = $20 2, Carrot x 3 = $10 3, Milk x 5 = $30 Total Items : 3
Sample Formatting 3
Item 1 Onion | Qty : 2 | Price : $20 Item 2 Carrot | Qty : 3 | Price : $10
Item 2 Milk | Qty : 5 | Price : $30 Total Items : 3

Limit Line Items

This helps you to limit the number of line items to be included in the message, you may have 100 of line items and including all of them in the message may not be a good idea, so you can use the option to limit the number of items to be included, if you put 5 then only first five items and its details will be included while sending the message

Store Converted Result To

This helps to store the formatted final item into a value and you can make use this in the Broadcaster or Send Message Action in any Steps
Last modified 3mo ago