Chat GPT gave me this code for the Compose Action.
if(equals(variables('pregunta'),variables('jsonPreguntas').jsonPregunta),variables('jsonPreguntas').jsonNumeroPregunta)
But it's not working.
Do you know how I can do this?
Variable = "Cat"
[
{"pet": "dog",
"color": "black"},
{"pet": "cat",
"color": "orange"},
"pet": "mouse",
"color": "white"}
]
new Variable = orange
I need to obtain the other parameters that match with my variable.
Maybe I'm not using the json array correctly or something.
Please, I would appreciate your help!
It did work!
Thank you so much!
These transformations can bedone with simple objects.
Here an example flow where the trigger input is transformed to the according number:
"Test" Input:
outputs('Transformation')[triggerBody()['text']]
The flow run looks like this:
First of all, thank you.
But I think I didn't explain myself so well. So sorry!
I need to "transform" the answer to an equivalent index. If the answer was Cat, then I need the variable set to 1. If the answer is Dog then variable = 2, and so on.
I need to do this with 2 questions, the first one has 6 options, but the second one has 41 options, so I hope the answer to my problem is not booleans or parallel branches.
Best regards,
Javiera
Hi @javieracortes04 ,
I've made a test for your reference:
1\The Form
2\My flow
3\Result
Best Regards,
Bof