Passing Values to SQL queries not working

  1. My goal: Retrive values form SQL
  2. Issue: Passing a list of strings after converting the array to a SQL query returns empty objects. If the same values are hard-coded, it works as expected.

JS block:

   const list = query1.data.map(row => '${row.Name}');return list.join(',');

Result:

   Type: String, Values: β€˜abcd’, β€˜cde’ 

SQL query:

select * from Table1

where Name in ({{code1.data}})

Result: {}

Can someone please advise?

Thanks

modify your JS block to return a array:

const list = query1.data.map(row => row.Name);
return list;

after that try to retrive value from sql

1 Like

Hi @rtulachan,

Was @Anuragsinh's suggestion able to solve your use case?

If not, can you share some screen shots if your query, the query output and the javascript query and its output?