Can we update Conditions in an SQL Query which is in a Asset using the Values from Excel file. Every time the Bot runs

Hi #UipathCommunity.

I have an Excel file with an input Data.

and here is how my Query looks like.


(In this Query, We create coloumns ActivityCodes and Notes and Based on the ContactListName we update the Activity code and Notes. )
image
(In this Query we are pulling only those 6 ContactListName rows.)

In the Above Excel file there can be any number of rows, Sometimes only 3 or sometimes 20.

So i want the Bot to read the Excel file and Update those conditions in Query Based on input from from the Excel File in an interactive manner Everytime the Bot runs.

Is it Possible? if Possible then How to Approach it?

Thankyou.

@Bhagyaraj_Digumarthi1

It is possible in the query in place of contqct list values use some place holder like contant_list_name IN ('<Contactlist>')

Noe say the query is in string str then use str.Replace("<ContactList>",String.Join("','",dt.AsEnumerable.Select(function(x) x("contact_list_name").ToString).ToArray))

This will join all the strings in the column with ',' and the. Will replace the string

Cheers

Thanks @Anil_G
Is this the Same Approach for Case Statement also?

@Bhagyaraj_Digumarthi1

Approach would be same…but on what you would join would change…depending on the joining string or symbols used

Cheers