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 / for each item in datat...
Power Automate
Unanswered

for each item in datatable

(0) ShareShare
ReportReport
Posted on by 2

Hi all,

 

In the flow, I use the following actions: 1. Attach to an executing Excel file. 2. Read the entire worksheet and save it in a variable of type ‘DataTable’. 3. Use the ‘For Each’ action on the DataTable to perform specific actions. Namely: 3.1. Execute a VBScript to change the value of specific cells in the table. 3.2. Attempt to capture the already changed value in a variable with the condition ‘item["column name"]’, but it doesn’t capture the correct value. Why?”

I have the same question (0)
  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    Can you show a screenshot of your flow? 
    What value does it give then? Does it give any value or an error?

  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at

    Hi @Rusinov 

     

    It should be your item['column name']

     

    Just replace your double quotes to single quotes

     

    Check below for your reference

     

    Srini007_0-1716193928509.png

     

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

  • Rusinov Profile Picture
    2 on at

    input file 

    Rusinov_0-1716193477731.png

    my flow

    Rusinov_2-1716193806392.png

     

    output file after run vbs script 

    Rusinov_3-1716193871291.png

    variable in power automate 

    Rusinov_4-1716193913821.png

     

     

     

  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    Problem is that your loop is using the old datatable. You need to read the excel again to get the updated status.
    Your For each is using the Step 2read from excel which has data that was not updated. The VBScript updates the Excel directly and not your dtQueue variable that is used in For each and then in the set variable Item['Status'].

    So either read the excel again in the for each loop or use WScript.Echo and then refer to the VBScriptOutput when setting the status variable.

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @Rusinov 

     

     I agree with @eetuRobo thoughts.

     

    But could you please share vbscript screenshot to investigate further on this issue?


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard