Skip to main content
Inspiring
Jan 12, 2022 10:43 AM UTC
Question

Query Database Passing a parameter using IN Condition

Hi All,

Did anyone tried passing the parameter as in condition for a query database smart service

For example : update tablename set status="test1" where case_id in ac!caseId

How to pass the case ID values of multiple and what is the type of the parameter for this?

    9 replies

    agamb0001
    Participating Frequently
    Jan 12, 2022 1:05 PM UTC

    If you are using mysql, then you can use a query like:

    UPDATE tablename  SET status="test1" WHERE FIND_IN_SET(case_id, ac!caseId)

    and the ac!caseId can be set to:

    joinarray(pv!caseIds, ",") 

    where pv!caseIds can be your case id's (I assumed its of type number integer - multiple)

    harshavAuthor
    Inspiring
    Jan 12, 2022 1:10 PM UTC

    Hi [mention:d8b421a354554ef089fa196070da6bf2:e9ed411860ed4f2ba0265705b8793d05] we tried like this and it didnt work for multiple values. can you help in any other way

    agamb0001
    Participating Frequently
    Jan 12, 2022 1:14 PM UTC

    well, It worked for me for multiple values as well.

    Here are some screenshots of how I configured. 

    and I verified the table values were updated as well