At the moment I have a Flow which does the following
- Opens Excel
- Writes Sheet1 to DataTable1
- Writes Sheet2 to DataTable2
- Uses Find Children and it’s appropiate filter to scan a webpage for selected text
- For Each - Contains a ‘Get Text’ for each UI Element found and copies to variable
- Message box with variable allocated to it - to confirm it’s working
Now I need to get the information back to Excel. So I…
- Within the For Each of Find Children I put a 'For Each Row in Datatable2
- Added an assign relating to the variable found using ‘Get Text’
- Added a Write Range to put the information to Sheet2
The Flow produces no errors and the message box confirms it’s capturing the data, but it’s not putting the data back to Excel - any ideas on this one?
Instead of write range, try like
- Either assign it to DATATABLE first and then write it to excel later once all data is processed
That can be achieved by
— once after getting the output from get text as a string variable use a assign activity like this inside the same loop
CurrentRow(“your column name”) = strinput.ToString
Where Strinput is the variable we get from get text activity and CurrentRow is the for each row variable
Or
- We can write it to excel with WRITE CELL activity
Where in write cell pass the output variable from get text activity as input to write cell and mention the cell range like this
Convert.ToChar(65+dt.Columns.IndexOf(“your column name”)).ToString + (dt.Rows.IndexOf(CurrentRow)+2).ToString
cheers @steve1977beyond
Hi there, thank you for replying. I have done Step 1 as you suggest but this doesen’t work unfortunately. The Flow runs with no errors but it doesen’t paste the data back into Excel, despite it being instructed to do so