I achieved a solution, but I find it very complicated. If there is any better way to do it, I would be happy for advice:
I have this data structure out of a API:
[{ "a":"value1", "b":"value3, "parties":[{ "email":"abc@domain1.com", "name":"david smith" },{ "email":"def@domain2.com", "name":"Martha Smith" }] }]
This data is going to be saved in a table. I need to add one field called “typ”. The content of the field is “apple” in case one of the domains ends on “domain1.com”. If not it should be “pear”:
for example:
[{ "a":"value1", "b":"value3, "participants":[{ "email":"abc@domain1.com", "name":"david smith" },{ "email":"def@domain2.com", "name":"Martha Smith" }], "typ":"apple" }]
To achieve this I added the two modules “Create JSON” and “Parse JSON”.
In the field “typ” of the “create JSON” module, I’ve included this function:
{{if(contains(toString(map(7.participants; "email")); "domain1.com"); "apple"; "pear")}}
It looks way to complicated to me, however, as a beginner, I did not find a easier way to achieve this.