Need to access only one value from 2nd column in excel sheet

Hi

Need to access only one value from 2nd column in excel sheet and if its valid then need to update 3rd column as pass
also want to update other items as pass in 3rd column for all other data items present in column 2nd

how can we do that
Thanks

@Vikram212

  1. Use Workbook Read Range Activity where you get the Output as a Datatable.

  2. Use For Each Row Activity for that Output Datatable
    Inside for Each Use an If Condition to Check if row(“2nd Column”).TToString is Valid
    If true
    Use An Assign Activity, row(“3rd Column”) = “PASS”
    Else
    Do nothing

  3. Write the Datatable back to the Excel File using WorkBook Write Range

Hi @Vikram212 Do u have multiple values in 2nd column?

yes Sir

like i said above - i need to check only one item from 2nd column not all

@Vikram212 So check First Item in the Second Column, and If it is Valid Update 3rd Column in all rows to “PASS” else do not Update anything ?

yes but how to do that in for each or assign

@Vikram212 Just need to change a bit of Logic i guess

  1. Use Workbook Read Range Activity where you get the Output as a Datatable.
  2. Use For Each Row Activity for that Output Datatable
    Inside for Each Use an If Condition to Check if DT(0)(“2nd Column”).ToString is Valid
    If true
    Use An Assign Activity, row(“3rd Column”) = “PASS”
    Else
    Do nothing
  3. Write the Datatable back to the Excel File using WorkBook Write Range

I hope this is what you needed :sweat_smile:

image

it gives me this error in if condition

@Vikram212 How are you checking the 2nd Column is Valid or Not :sweat_smile: ? If condition requires a Boolean Value, So just A String isn’t going to be validated, You need to Check if String is Empty or other Condition like that

so even if i write entire condtion :rofl: :joy: :upside_down_face:as per ur expression it gives me the same eror

image

@Vikram212 Check in this way :
dtReadRange.Rows(0)(“Robot”).ToString=“valid”

1 Like

ok something is working
Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.