Using a query ouput as input to a saved query

I have a saved sql query I would like to use with input which is a column from another query

The query I have works fine while referencing a single cell , or inserting a string, but not by inserting multiple strings, or referencing a full column.
This works:
{{table2.selectedRow.data.session_id}}
{{query3.data.session_id[1]}}
id_abc123

This doesn't:
id_abc123, id_abc125,id_abc125
{{query3.data.session_id}}
{{query3.data.session_id[1]}}, {{query3.data.session_id[2]}}

The part of the saved query that uses the parameter is:
where sessions.id in({{ variable0 }})

The options that don't work result in an empty result, not an error.

If I use a regular (not a saved) query, then
sessions.id in( {{query3.data.session_id[1]}}, {{query3.data.session_id[2]}}) works
while where sessions.id in( {{query3.data.session_id}}). I tried several transformers on query3, including Array.of(data.session_id), which didn't work either

Change this to sessions.id = ANY({{ variable0 }}) since you are (I think) passing an array as variable0. I think you should be using variable0.value as well.

2 Likes

thanks! this worked!

2 Likes