HOW compare two columns in excel

How compare two columns in excel .
And columns value compare to the first 8characters…

Please help me …

Hello @Vishnu_Reddy1 ,
will you show us the sample Excel sheet

Hi @Vishnu_Reddy1

  1. Read range activity - Store it as Dt
  2. For each row in DataTable
  3. If condition

Condition

Currentrow("ColumnName1").Tostring.Substring(0,8).contains(Currentrow("ColumnName2").Tostring.Substring(0,8))

Let us know if it not working

Regards
Gokul

Hi Balaji
Tq for helping me

Condition is not working…


I am compare the F48 and G49 columns…

Please help me…

Hi @Vishnu_Reddy1

Both columns are in Different excel?

Can you share the sample input

Regards
Gokul

No Balaji

Both columns is only one excel F48 and G49

Hi @Vishnu_Reddy1

  1. Use Read Cell activity (F48) → Store it in CellF48
  2. Use Read Cell activity (G49) → Store it in CellG49
  3. If activity
CellF48.Substring(0,8).ToString.Contains(CellG49.Substring(0,8))

image

Regards
Gokul

Hi, what does it mean " Substring(0,8)"

Hi Balaji
Tq for helping me

This code is Not working error in code .


hi @Rulo.RA

It will get the first 8 character of the string

Reference

Regards
Gokul

1 Like

Hi @Vishnu_Reddy1

CellF48 and CellF49 is the string variable for the Read cell activity

Regards
Gokul

Hi Balaji
Also same error
In this code
Please help me

Hi @Vishnu_Reddy1

once again try this below method,

CellF48.Tostring.Substring(0,8).Contains(CellG49.Tostring.substring(0,8))

Hi!

Did you create the variable at the Output from ‘Read cell’?

You need to create two variables (One for each Read cell activity) and place them into the Output of that activity.

Then, you’ll be able to do anything you want with the strings (Compare, edit,etc.)

Can you send an image from the property of Read cell please?

Hi
Mukesh

It’s same error

Hi @Vishnu_Reddy1

I would suggest you to study more details in https://academy.uipath.com/

Regards
Gokul

1 Like

Hi @Vishnu_Reddy1 ,

  1. click the variables panel,

2.To verify The two names of Datatable variable scope should be outer most of the level,

Example:(CellF48 - Scope(Top Of the Sequence is called first you put the sequence name to change in the variable)

Try once again ,If not working means you share your workflow i will check

1 Like

TQ Mukesh

Please help me

Hi @Vishnu_Reddy1

Instead of CellG49 → Pass G49
Instead of Cell48 → Pass F48

If it is not working kindly share the XAML file here

Regards
Gokul

You have used the activity - Read Cell Twice. See in the properties panel for those activities and Mention variables in the Output as - Cell48and CellG49 respectively. And also, check the protection level. That will work for sure