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

Notifications

Announcements

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

 

I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard