How to check the variable value is exist in database or not

Hello, community

I have a variable that contains the looping value and I want to check that value is present in the MySql Database table or not.

For example:
Name = Jamal

MySql Database :

User Name
Jamal
Mohit
Aman
Karan

If the variable value i.e Jamal already exist in the table then Ok but if not then need to insert it into the data table

What will be the if the condition for this?

Thanks in advance

Best Regards,
Vrushali

@Vrushali_Gave

Check below for your reference
Tutorial : How to check a string is present in Excel Sheet || Part - 1
Tutorial : Another way to check the string is present in Excel or Not
Tutorial : Check value exists in Excel Sheet using UiPath (Part-3) | Without using ForEach Loop/FilterDatatable

You can check anyone of the above

Hope this helps you

Thanks

@ksrinu070184 I have MySql database and I want to check in it.

@Vrushali_Gave

write a Execute Query like below

Select * from TableName WHERE User Name = ‘Jamal’-> Output is Datatable

Now in IF Condition write as below

Datatable.Rows.Count > 0

Then-> Value is present
Else -> Value not present

Hope this helps you

Thanks

2 Likes

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