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 / Automatically create v...
Power Automate
Unanswered

Automatically create variables in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I tried to make, in Power Automate Desktop, an automatic number of variables, based on the number of elements in the array, but it didn't work. I have a certain string that is parsed from a pdf document and the elements are saved there. The number of elements in the array is variable.
How to create a variable number of variables based on the number of elements in a variable array?

Any suggestion is welcome

Thanks in advance

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @adisprijic 

     

    I don't think we can do that, may be can you explain your usecase to understand why you need such a requirement ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • adisprijic Profile Picture
    2 on at

    Hello,

    Thanks for your answer @Nived_Nambiar 

    I want to create an automatic posting of a bank statement in the sql-local ERP system.
    Sometimes a bank statement has 4 or 5 items, and sometimes it has 10-20. A bank statement arrives every day. therefore, the number of rows is not equal on any extract.
    So, in order to place the data in variables after parsing, I need to create as many variables as there are lines on the bank statement (sometimes it's 5, sometimes 10 or even over 20).
    For this purpose, I need to find a model of how to use PDA to create "n" variables based on the number of elements in the sequence

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Unfortunately, we have all tried to do this at one time or another. But, as with all coding languages that I have worked with so far, all variables must be defined prior to running, and you can’t use a variable to create a variable. 

    The most practical way to work around this is to list your variables in column A of an Excel document, and list the value in column B.  In C1, you will have an input field, and in D1, you will have a vlookup formula, =Vlookup(C1,A:B,2,false).

     

    when you need a variable, you call it by writing the unique variable to C1, and reading D1 to your reusable variable. 

    best of luck!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You don't really need to define each item of the statement into a separate variable. You just need to put them into a list of values, or a data table. They do need to be processed the same way anyway, so there is no need to define them as individual variables.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard