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 / Trying to paste the se...
Power Automate
Answered

Trying to paste the second value from a DataRow as I'm going through a 'for each' loop of my list

(1) ShareShare
ReportReport
Posted on by 11

Hi,

I'm trying to take the second value in my DataRow but Power Automate just seems to hate me.

 

I'm creating a DataTable of football players and assigning an injury value to them in the second column from a webscrape. I'm then going into my excel sheet, finding the player name and then pasting in that injury value into the correct cell for my formulas.

So, as it goes down my list of player names in the 'for each' loop I need it to copy their value in the second column.

 

CLamb97_0-1692628080798.png

 

 

I initially tried doing this in excel rather than as a DataTable and it seemed an impossible task to get Power Automate to understand it needs the value in the selected row rather than the value in the first row. I've had a range of issues using the DataTable method. From the short section on the wiki it says I can use %VariableName['ColumnName']% or ItemNumber but using the DataTable as the variable gives me the error "value #2 doesn't exist". 
Any method I've managed to get working only results in a single value being applied to LivePercentData and that same value being pasted for every single player found.

This seems like a very simple task to me but after days of trying I can't get it to work, please help

Thanks,
Chris

I have the same question (0)
  • trice602 Profile Picture
    16,397 Super User 2026 Season 1 on at

    Hi @CLamb97 ,

     

    Here's an example of using the extracted datatable values. You refer to row 1 as [0] and column 1 as [0].  In this example I only have one row I am scraping from a website but if you have a datatable with multiple rows, you would turn the row [0] into a variable and increment it as you loop through rows, so for row two you end up with [1][0], [1],[1],[1],[2].  At the end of the loop, you increment your [row] variable +1.

     

    trice602_0-1692629323657.png

     

     

     

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    When you target a table, as you did in your screenshot, you need to provide the row index first and then the column index. But I don't really see why that is necessary anyway. You should simply modify your loop.

     

    Instead of doing a For each on your %AvailabilityNameData%, do it on your %DataTable% variable. When you do that, your current item will be a data row that contains both the name and the percentage (instead of only the name). You can then access the name as %CurrentItem[0]% and the percentage as %CurrentItem[1]%.

     

    Please note that indexes are 0-based, so column 2 is accessed via index 1.

    -------------------------------------------------------------------------
    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.

  • CLamb97 Profile Picture
    11 on at

    Thanks for the help Trice and Agnius,
    I was working through Trice's method and working through some errors; but Agnius' method is definitely the easiest and correct, worked first time!

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 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard