Skip to main content
Best answer

Want to apply where condition in trigger response in test data


Hello ,

I integrated my application with Session auth. now I am going to create trigger its work fine. But the problem which I face is, want to apply condition that the value return only when type is 3.

Should I do this in code? As in image I want to apply “item[“type”] = 3” in response.
 

 

Best answer by ikbelkirasanBest answer by ikbelkirasan

@truvelop - Sorry I responded too fast and didn’t read the entire question.

You could do it directly like this without the .map function since it doesn’t add anything to the items.

const lists = results.data.filter(item => item.type === 12);

 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • July 7, 2022

Hi @Harshida - The way it’s written isn’t a valid JS syntax. Here’s how it should be:

const lists = results.data.filter(item => item.type === 3);

 


  • Beginner
  • 1 reply
  • July 7, 2022

Hi @ikbelkirasan 
Harshida here.
Thanks for your response but I got the solution 

I apply the condition this way and I got the result.


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • July 7, 2022

@truvelop - Sorry I responded too fast and didn’t read the entire question.

You could do it directly like this without the .map function since it doesn’t add anything to the items.

const lists = results.data.filter(item => item.type === 12);

 


  • Author
  • Beginner
  • 3 replies
  • July 7, 2022

Hi @ikbelkirasan  yes its work fine when apply this. Before to apply filtration I got the error for Id so I apply “map” on my response.

thank you so much