web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Utilize a variable as ...
Power Automate
Unanswered

Utilize a variable as a node name when iterating JSON

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I've converted JSON to a custom object and I'm now attempting to utilize a For Each to ultimately obtain the data I require. I've done this many times without issue but I've hit a stumbling block.

 

The third node on the JSON is dynamic as it refers to a site reference. Fortunately, I have the site reference as a variable. 

 

Ideally, When setting the 'Value to Iterate' on my For Each i want to use a variable for node 3:

 

%JSONObject['node1']['node2']['%SiteRef%']['node4']%

 

Where you usually reference a variable within a variable by simply stating the name of the variable without %, When i do this here, it of course believes I'm referring to an actual node name. 

 

If using a variable cannot be done, as there's always only one site reference node, can a wildcard be used? I've tried to use an index of [0] but this can't be done either. 

 

Any suggestions would be much appreciated!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @walking999 

     

    Try this appraoch 

    Nived_Nambiar_0-1679834137099.png

     

    here var is the variable

    flow 

    Nived_Nambiar_1-1679834156476.png

     

    Hope it helps 

    Mark it as solution if it resolves your query

     

  • walking999 Profile Picture
    2 on at

    Hi

     

    Thanks for your reply. Unfortunately this doesn't work as i'm trying to use it on a For Each so when i enter a variable without '' it throws the error; "Variable 'JSONCusObject' must be a list, datatable or datarow."

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @walking999 

     

    Would it be possible to share sample format of json which you are using that would be helpful 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 271

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard