Take a specific excel cell based on variable

I have 3 columns in Excel.
They look like that:

Center Username Password
01 Username01 Password01
02 Username02 Password02

And so on until 63 row.
I have a variable that store the username, that needs to be login.
So my idea is to compare my variable with the column username to find the exact username.

Then I must take that username with the password.

Not sure how to do that.

Thanks in advance.

Use Read Range then
Use for each row for iterate each row
in that

Hi Greetings…!

Please use this in assign activity,

ReqValue = inputDt.AsEnumerable().Where(function(x) x(“Username”).ToString.Trim=UserNameVariable.Trim).CopyToDataTable.Rows(0).ItemArray(2).ToString

This will return you the output at one shot without loop…!


1 Like

Hello, @kadiravan_kalidoss.
I’m getting this error
AsEnumerable is not a member of uipath.
I check for solution here.
But didn’t work. So I switch to my backup version.

Your idea is working, but don’t have good behavior.
This loop is making wrong things like again and again open files.
I just need something that can do this without loop.
I’m trying to figure out how is doing that.

You can uncheck the visible option for excel…
Or u can use your variable in LookUp Range
so you will get output like this
For Username01--------B2
if op of Lookup range is contains any data
then Read Cell C+LookUpOutPut.substring(1) will give you the password