Question

How do I simply add an element to line item data in Zapier, even if it starts empty?

  • 13 February 2024
  • 7 replies
  • 38 views

I have some line item data I need to add an element to. Sometimes, the line item already has elements in it; sometimes it starts empty. At first, I just added the element like this:

 

[original data], new data

 

But then, if [original data] is empty, there is an empty element before the new data.

 

Now, I’m doing this:

  1. Transform Line-item to Text: [original data]
  2. Transform Spreadsheet-Style Formula: IF(ISBLANK("{{text-ized line item}}"),"new data","{{text-ized line item}},new data")
  3. Transform Text to Line-item

This seems way overly complicated. Is there a simpler approach? 

I thought Line Itemizer could help, but it only seems to work for arrays of objects, not simple arrays of strings.

Thanks!


7 replies

Userlevel 7
Badge +14

Hi @michaelkn 

For us to have more context, please post screenshots with how your Zap steps are outlined and configured along with specific examples.

Here are screenshots:

 

 

 

 

Userlevel 7
Badge +14

@michaelkn 

How are you trying to use the data after the Formatter steps? (screenshots are helpful for us to have context)

There’s a field in a later Action step that sends data to Airtable to a multiple-choice field that accepts arrays of data:

 

 

Userlevel 7
Badge +14

@michaelkn 

Try this…

You may not need the Formatter steps.

In the Airtable field, map the values like this:

STATIC,[DYNAMIC]

 

That way if there are no dynamic variable values, Airtable should ignore after the first comma.

Yes, that’s what I tried first, but Airtable unfortunately doesn’t ignore it, and creates an empty element (regardless of the order of the static and dynamic content).

Userlevel 7
Badge +14

@michaelkn 

Try simplifying the formula to this.

If there are dynamic values, then [DYNAMIC],STATIC
Else, just STATIC

 

Reply