Skip to main content

Hi all,

[What I want to accomplish]

I want to judge whether data in a value in my line-items has a specific search words.

For Example, line-items are like this:

-----

groups:

 1:

   group_id : price_1Aa

   group_pk : 67

  2:

   group_id : price_1Bb

   group_pk: 66

  3:

   group_id : price_1Cc

   group_pk : 65

-----

I want to judge whether "group_id" (a value in line-items) has "price_1Aa" (data in line-items) or not.

Is there any good ways to judge above?

I want to use Zapier support Apps like Formatter by Zapier, more than Code by Zapier.

As a condition, I can't control the order or number of line items that are going to come in. At least, 1 line-item comes in.

 

>What I did]

1) Formatter => Text => Find

It doesn't work as I expected, when "group_id" has data "price_AaA",and my search word is "price_Aa".

It is because "Find" judges whether "price_AaA" contains "price_Aa", but can't judge "price_AaA" is exactly "price_Aa" or not.

2) Formatter => Number => Spreadsheet-Style Formula

I tried the following zapier article below. 

https://community.zapier.com/featured-articles-65/how-to-extract-a-single-line-item-regardless-of-number-or-order-of-line-items-4575

My formula is like this:

IF("price_1Bb, price_1Aa"="price_1Aa","65,67","")

However, nothing is extracted like below in Test action.

-----

output: 1:

-----

Plus, I think this approach is not best because this formula does not return just true or false.

Hi @phyat 

You can use Formatter > Utilities > Line item to text, to convert the entire line-items to a plain text format.

Then you can use Filter > Contains and check the entire line-items for your match. You can use Path to route data into 2 different paths when it contains and when it doesnt.


Hi @robschmidt 

Thank you for your quick response!

I tried your advice, but It doesn’t work as I expected.
I want to judge whether data in line-items exactly matches my search word.

However, thanks to your advice, I found an zapier artcle which solves my problem.
https://zapier.com/help/create/customize/filter-and-path-rules-in-zaps#step-6

Thanks again for your help.