Hello,
I have a list of variables (webbrochure1 to webbrochure10) that can potentially store a value. I was trying to run a Do Untill loop based on an index and dynamically read the content of the variables. something like : variables(concat('webbrochure',variables('Brochure Index')))
I guess maybe i could use Arrays to store the same data to loop through the index but not able to think through it.
The issue is for some reason the variables function does not seem to accept anything but the name and i get the following error when i try to output this in a compose action:
Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The template action 'Compose_2' at line '1' and column '10435' is not valid: \"The template function 'variables' is not expected at this location.\".'.'."}}". Code: 0x80060467 InnerError: '.
When a row is added, modified or deleted
contains(...)
bool(...)
Below is the flow:
Any suggestions on how i could change the variable name inside the variable function ? Thanks.
Solved! Go to Solution.
Hi @Nithin_Vanam ,
I don't think, you can pass or construct the variable name dynamically. During each save, Power Automate validates whether the given variable name is initialized before its usage or not. If you construct the variable name dynamically it can't validate it and it is throwing template validation error.
This will work,
@{concat('temp_',variables('index'))}
But the below one will fail.
variables(concat('temp_', variables('index')) )
Hope this is clear.
Thanks,
Murali
Please Like and Mark this as Answer if it resolves your Issue.
Hi @Nithin_Vanam ,
I don't think, you can pass or construct the variable name dynamically. During each save, Power Automate validates whether the given variable name is initialized before its usage or not. If you construct the variable name dynamically it can't validate it and it is throwing template validation error.
This will work,
@{concat('temp_',variables('index'))}
But the below one will fail.
variables(concat('temp_', variables('index')) )
Hope this is clear.
Thanks,
Murali
Please Like and Mark this as Answer if it resolves your Issue.
User | Count |
---|---|
87 | |
37 | |
25 | |
13 | |
12 |
User | Count |
---|---|
117 | |
55 | |
36 | |
23 | |
21 |