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 Automate
Unanswered

Nested Variable...

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Below "generates a random number" between 0 and the last row of an Excel data table, single column, 10 rows etc.

Between 0 and %ID_ExcelData.RowsCount%

Basically gives me a random row number within the range, 0-9 etc. (zero based index obvs ).

 

Trying to print the row is where im having the issue, syntax error.

%ID_ExcelData[%RandomNumber%]%

 

Had a look on the forum etc but to no avail.

I tried split text on the data table to give me a list but no joy.

 

Thanks, Mike.

I have the same question (0)
  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    %ID_ExcelData[RandomNumber]%

     

    You don't need the %s on a nested variable.  So, this would give you a datarow variable which I believe is just a list variable with each cell on a different line.

  • UK_Mike Profile Picture
    on at

    Hey Mike,

     

    Perfect and within 4 minutes lol.

    As you may be aware you helped me out when I had a similar issue a few days ago where I forgot to put the text var into a list var, I thought this was the same issue but no.

     

    Thanks again Mike 😀

     

  • princepabari Profile Picture
    3 on at

    @MichaelAnnis Thank you, sir!
    I was trying to loop through the data table using for-each loop,

    for that I did something like this:
    %ExcelData[LoopIndex][0]%

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard