In Zapier code I want to check if query.XXX or query.YYY is part of the received data.
It is super stupid made, but it cant be fixed → so I can’t just take it as one input data.
So how to check if query.XXX is part of the request
Thank you
In Zapier code I want to check if query.XXX or query.YYY is part of the received data.
It is super stupid made, but it cant be fixed → so I can’t just take it as one input data.
So how to check if query.XXX is part of the request
Thank you
Thank you - let me try 🙌
Data example 1:
The check on if those exist (12 in total)
querystring__Komplet_Polering
querystring__Bundbehandling
querystring__Maling
querystring__Krsel
querystring__materialer_og_miljafgifter
If exist in query I need to define a variable with the value.
So Komplet_Klargring = 6195
Each of these are variables with values that can be mapped to following Zap action steps using the custom mapping option.
Not as I see it.
Sometimes the endpoint is given:
querystring__Komplet_Polering
querystring__Bundbehandling
Next time:
querystring__Bundbehandling
querystring__Maling
How do set Komplet_Polering to 0 in the second?
In that case, you’d need to map every possible variable as an input in a Code step.
Then in the Code step you can do this.
EXAMPLE
Inputs
Var1 = {Var1}
Code (JavaScript)
let Var1 = inputData.Var1 || 0; // set default to 0 if no input variable exists
let Var1 = inputData.Var1 || “”; // set default to “” if no input variable exists
let Var1 = inputData.Var1 || null; // set default to null if no input variable exists
let Var1 = inputData.Var1 || false; // set default to false if no input variable exists
Help article about how to use the Code step: https://help.zapier.com/hc/en-us/articles/8496197098253-JavaScript-code-examples-in-Zaps
Hi
Good question.
Perhaps you can use a Filter step instead of a Code step: https://zapier.com/apps/filter/help
Otherwise, provide more context about how you are trying to configure your Zap steps.
Thank you for the reply
The system I use is super stupid, but if a product is selected it shows a value.
If the product is not selected, it is removed from the data (response).
So I have to somehow check if the name exists in response and then define a variable.
And I have to do that on 10 products.
Does it make sense?
Sounds like a series of IF statements would work.
This related article might provide guidance.
If you need help configuring the Code, consider hiring a Certified Zapier Expert: https://zapier.com/experts/automation-ace
IF statement search for value not the query. So in the article I need to know if it is “Joe”. The value on my query is a random number.
Any other ideas?
Thank you so much
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.