Best answer

How do I search line-items data with Zapier support App?

  • 7 September 2022
  • 2 replies
  • 294 views

Badge

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.

icon

Best answer by phyat 7 September 2022, 07:22

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +9

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.

Badge

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.