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 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 🚀
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.
input file
my flow
output file after run vbs script
variable in power automate
Hi @Rusinov
It should be your item['column name']
Just replace your double quotes to single quotes
Check below for your reference
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
Can you show a screenshot of your flow?
What value does it give then? Does it give any value or an error?
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2