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 / Using List element as ...
Power Automate
Unanswered

Using List element as variable

(0) ShareShare
ReportReport
Posted on by 8

Hi @ all,

 

I have many variables. For half of the variables I have to test if they are empty. Now I can build hundreds of if controls but that would be very time consuming (especially in maintenance).

 

My idea was to create a list with the variables that need to be tested and then take a For-Each loop and go over the list. But I fail to access the "real" variable with the %CurrentItem%. The If-Condition should not test if %CurrentItem% is empty, it should test if %ListElementName% (e.g. %Test%) is empty. Do you understand what I'm trying to archive? Any ideas?

 

PAD_Explorer_0-1656516878303.png

 

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    You cannot reference variables like that.

     

    One (maybe the only?) method could be to create a large custom object to hold your variables and their content. A list would then be necessary (and make it possible) to loop through all the key/value pairs.

  • PAD_Explorer Profile Picture
    8 on at

    @Henrik_M wrote:

    You cannot reference variables like that.


    Ok,  I thought so also.

     


    @Henrik_M wrote:

    One (maybe the only?) method could be to create a large custom object to hold your variables and their content. A list would then be necessary (and make it possible) to loop through all the key/value pairs.


    Thank you for your advise. Can you give me a hint more, please? What do you mean with custom object? Should I build a String formated like an JSON with {"VariableName":"VariableValue",....} and what's next ? Can PowerAutomate work with JSON? I tried to build a table by my own, but that didn't work but would be perfect...

  • Gidi Profile Picture
    601 on at

    Hi,

    maybe this page helps you to find details about the custom object and how to use it 😉

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-types 

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
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard