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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard