Best answer

Want to apply where condition in trigger response in test data

  • 7 July 2022
  • 4 replies
  • 35 views

Userlevel 1

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.
 

 

icon

Best answer by ikbelkirasan 7 July 2022, 13:14

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.

4 replies

Userlevel 7
Badge +12

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);

 

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

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

Userlevel 7
Badge +12

@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);

 

Userlevel 1

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