Dynamic SOQL query

I'm trying to build a dynamic SOQL query in a Salesforce Resource query (query type SOQL query)

For example, pretend the preceding block is called code1 and returns a string of comma delimited single-quoted IDs for an IN clause, I want to execute a SOQL query like:

select Name, Id from Contact where id in {{code1.data}}

When I type in the {{}} to hopefully inject the code1.data, my list of options are just for some JavaScript functions.

Is this functionality just not yet available in SOQL query workflows, or I'm missing something?

If this is impossible, then my option is to build dynamic SOQL in a Python code block, but sadly the Python code block doesn't support the simple_salesforce package. In 5 minutes I was off to the races with the Salesforce API via simple_salesforce.

On the other hand, going w/o it and trying the requests package (which Retool does have) I've wasted 2 hours simply trying to query count of contact object instances with stock packages - error code 401 all day long.

Hi David!

Can you try adding single quotes before and after your dynamic value? Your code would look something like this:

WHERE owner.email = '{{current_user.email}}'

I just tried this out in a query and the email just needed to be a string!

Victoria, I appreciate the help.

Maybe you could give feedback to the UI dev team that it would be helpful if input data objects would appear in the dropdown once users type {{

Right now, as my screenshot above shoes, typing {{ just brings up some JavaScript modules e.g. papa

Additionally, even once I've added data from a previous block e.g. filter1.data[0].run_id and the data from the previous block is successfully passed into the query, in the query resource editor filter1 is underlined in red as if it's screwed up.