โ03-31-2022 06:39 PM
New to Workat and I am working with a schema that has some nested arrays and I cant seem to figure out how to create a if condition that will be triggered if any option in the nested array contains the specific value.
Example:
create a if condition where "Interests" contains "swimming" so that the data in the schema below is picked up
{
"deliveryContext": {
"camper": {
"demographics": {
"address": "string",
"city": "string",
"state": "string",
"country": "string",
"phone": "string",
"postalCode": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
}
"Interests": [
{
"id": "34",
"value": "biking"},
{id": "27",
"value": "biking"}.]
}
}
โ03-31-2022 06:59 PM
It looks like the JSON has some errors in it but my guess is that the correct JSON is:
{"deliveryContext": {"camper": {"demographics": {"address": "string","city": "string","state": "string","country": "string","phone": "string","postalCode": "string","email": "string","firstName": "string","lastName": "string","Interests": [{"id": "34","value": "biking"},{"id": "27","value": "biking"}]}}}}
And the formula based on that would be:
["deliveryContext"]["camper"]["demographics"]["Interests"].pluck("value")
โ03-31-2022 07:00 PM
David Cornwell - thanks, I quickly copied and modified the json to act as an illustrative example. thanks for the assist.
โ03-31-2022 07:41 PM
I think this works, Sample i tried.
https://app.workato.com/recipes/2239282?st=157230
โ03-31-2022 07:45 PM
workato's "parse json" does not work with complex json unfortunatley