Filter data table and replace a value in a cell

I have an excel data table like this:
Name Status
ABC YES
DEF NO
GHI YES
JKL NO

I use Filter Data Table to filter the column “Status” = “NO” , save the output as DataTable1(which is the same as input) and use For each row to run the process because I just want to carry out the process for those whereby the status is a “NO”. After the process is done, I want to change the status from “NO” to “YES”.

I have tried using Assign(row.Item(“Status”) = “YES) and Write Cell to write DataTable1 into the excel sheet but I realise that it will replace all the data which is not what I want. I still want the keep those with a “YES”

The output I get: (something similar)
Name Status
DEF YES
JKL YES
GHI YES
JKL NO

What I’m looking for:
Name Status
ABC YES
DEF YES
GHI YES
JKL YES

Can someone help me on this, thank you so much!

Hi @CY_LEW

Perhaps this may help.

1 Like

Hi @CY_LEW

Please Refer to the xaml below.

Main.xaml (29.7 KB)

Hope this may solve!

Regards

Hi, thank you for your reply. Everything works well but the value doesn’t change from “NO” to “YES” after the process is done.

This is the expression I use:
DataTable1.Rows(CopyDataTable1.Rows.IndexOf(CurrentRow))(“Status”)

Hi, thank you for your reply. However, I can’t really understand how this can be applied to my scenario.

Hi @GreenTea

Assumed that you need to change from the status ‘NO’ to ‘YES’.

What I’m looking for:
Name Status
ABC YES
DEF YES
GHI YES
JKL YES

Regards

Hi @CY_LEW , @pravin_calvin

A mistake on the if activity where boolean expression should be uppercase “YES”.

CurrentRow.Field(Of String)(“Status”).Equals(“YES”). Put a break point and run in Debug mode, inside watch panel examine the ExcelDT