Writing to data back to Excel

Hi I have a BOT which does the following

Reads Data into datatable (dtInput)
Filters the Data - from multiple fields to 2
Now I need to update the filtered data in the original spreadsheet - assign a field to Y/N

I used the following in a for each

row.Item.("File #).ToString.Equals.row.Item.(File #).ToString

This errors but i’m not sure what the syntax should be?

I want to set the Field (Send Y/N) to N if the excel field (File #) = the datable field(File #datatable

Could someone point me in the right direction please?

It would help to share your workflow, but here’s my best guess of a solution:
You’d need to put the following in the for loop. Assign the index in the for loop property to a variable i. This is also assuming the rows in the datatable match up to the excel file.

assign cellVal = excel file > read cell activity (“B” & i+2)

if cellVal = row(“File #”).toString
assign row.item(“Y/N Field”) = “N”
assign row.item(“Y/N Field”) = “Y”

Here’s a workflow example
sand.xaml (10.1 KB)

Hi Greg

Thanks for the reply and the sample, so am I sort of understand the read cell, what does the & i + 2 do? (assume 2 is added to the index but why?)

In my case the datatable entries do not match the excel sheet as I have had to filter the sheet in the datatable

I did i + 2 because i starts at 0, and I assumed row 1 in your excel sheet was the header row, which leaves row 2 as the first row of data.

Can you share a sample of the excel and datatable data?

Ill see if I get a screen grab, thank you