Check if data exists in data table

I am Shyam Sundhar.i am new to uipath,my first assignment is creating a login page containing user name and password.The user name and password have already been entered in the data table.Once i enter the data ie the user name and password,it should check if both the user name and password are existing in data table and return a message as exists.

I am stuck in the comparison part.So could someone help me solving this issue

@shyam1994,

Welcome to UiPath Community!

If you have username and password as the columns in the datatable then you can check like this,

yourDataTable.Rows(0)("Username").Tostring = "yourusername"

Check this in a IF, so it is true then the value exist in the table.

Please give some more information about your datatable to get better help.

2 Likes

my data table has two columns 1)userid and 2)password.I have added only one data row.
Now once i enter the username and password on the screen,it should check if both the username and password entered are correct and if it is correct,it should open the google chrome and open a url which i mention.
If the credentials are wrong,it should return a value as wrong credentials

If i have 5 usernames and passwords stored in my data table and say if i enter any one data in random,then how do i check if my username or password which i have entered is correct and do the corresponding action

Hi @shyam1994,
You may try in this way,
Let us say your “userid” column is the very first column in your datatable.
Now use an Assign Activity and assign the data in userid column in a variable like, Var=row(0).tostring.
Now use IF activity and in it type Var.Contains(“username”)
After that in the Then and Else conditions do what you want it to do.

i need to check if both user id and password entered are matching with that of the data table.Kindly provide a solution or if you have a workflow format u can just attach it

Very useful, thanks!