power-automatepowerapps

Need to use a changing variable inside another variable Power Automate


So in this expression in Power Automate I want to switch x by numbers from 0 to 85

%JSONfields['walk']['valueArray'][%x%]['valueObject']['obj']['content']%

The problem is that I can't use %% inside other %%. How would I try to solve this?

I tried using a Python script to write the line of code to be:

%JSONfields['walk']['valueArray'][0]['valueObject']['obj']['content']%
%JSONfields['walk']['valueArray'][1]['valueObject']['obj']['content']%,    

depending of the iteration it is at, but Power Automate wont accept it


Solution

  • Since x variable is inside the evaluation block it does not need % sign around it:

    %JSONfields['walk']['valueArray'][x]['valueObject']['obj']['content']%
    

    If you find my answer useful - please vote for it or mark as "Accepted".