Hey there, Zappers! Nick here, from the Community team. Today, I’ll be taking a look at the Formatter's Text to Line-Item feature.
You may think that you don't have a need for line items, and maybe you don't...yet. There's likely a day in the future where it will come up. Maybe you'll remember this article (or at least that it exists).
Wait, Nick! What are line items?
Oh yeah, sorry. As luck would have it, Tyler Robertson of Zapier recently published a comprehensive guide to line items that can explain it much better than I can in this article. Please refer to that if you need some clarification :)
This option can be found at:
Formatter by Zapier — Utilities — Text to Line-Item
What It Looks Like
There is only one field to fill out:
What It Can (and Can't) Do
Ways you can create line items from text:
1) Map 1 single field that contains comma-separated text
2) Map multiple fields, that are separated by commas
3) Manually type text into the field, meaning that it's not dynamic
4) Map line items into it, this creating nested line items
Things you can not do with it:
You can't specify the separator (using a period or semicolon, for example)
You can't create line items with multiple fields in a single Formatter step (that's where the Line Itemizer would come in)
Some Ways to Use It
1) Perform a Formatter step on multiple fields, in a single step
My colleague Clint recently wrote an article about this. You can read it here, if you'd like.
Let's say you wanted to capitalize a bunch of names that you've gotten from your trigger step. If you had 10 names, you certainly wouldn't want to create a Formatter for each one (especially if the number of incoming items will vary).
Solution: Create line items from those names, then use the Formatter step on ALL of those items, in one fell swoop:
If you need the values as text (and not line items) you can use this Formatter feature:
2) Create line items for invoices, orders, and receipts
Here, I'll quote Tyler Roberston, from the aforementioned guide to line items:
"The original definition for "line items" comes from invoices, and that's one of the most common places we see them in use. When creating a new invoice or receipt with apps like QuickBooks Online, Xero, or making orders in apps like WooCommerce, line items help you make sure that a new line is created for each line item, instead of adding them all in a big lump."
In this screenshot shared by Tyler, you can see that line items are supported because at tye very top it says "Line Items" and the fields are surrounded by that rounded border:
While we technically have a better Formatter feature to accomplish this (the line itemizer) there may be instances where you only need to use one Text to Line-Item step.
3) Create multiple rows in Google Sheets (which could then trigger another Zap)
Google Sheets has a handy action called Create Spreadsheet Row(s):
This allows you to create multiple rows, assuming you've got line items. And now you know how to get them!
You can even use multiple Text to Line-Item steps, like this:
And this is the end result:
How cool is that?!
BONUS: Trigger from each of those new rows in Google Sheets.
Now if you wanted, each of those new Google Sheets rows could trigger a separate Zap that does something like:
- add those names/emails to a CRM
- send each person an email, addressed by first name
- invite each person to an event, including a personalized message
Anything Tricky About It?
Knowing when to use this action can be a little tricky, but the more you practice and build Zaps, the easier it will become to identify use cases. It's also important to note that for anything more than 2 fields that you need in line items, we'd recommend the Line Itemizer (covered later in this series). You can technically use it for two fields and save yourself a Formatter step. But for simplicity's sake you may want to separate them into multiple Text to Line-Item steps (as we did for name and email above).
Coming Up in the Series
Next up in the Formatter Features series we'll be taking a look at the cousin of Text to Line-Item (which we hinted at above): Line-Item to Text. See ya then!