How to utilize dictionary values in Salesforce reader soql

How to I make this work to pull parent records. I have stored the list of Id’s in the dictionary.

Id does not like this: dict:parentIdCSV:discrete

Select FIELDS(ALL) From Account WHERE Id in dict:parentIdCSV:discrete

Hello Jeff,

Unfortunately, the way how the SalesforceReader component is designed to work renders using this approach not viable. The dictionary reference cannot be dynamically resolved within the SOQL query directly. This leaves us with the only other option for dynamic placeholder resolution and that’s by using parameters.

As you may already be aware of, parameters get resolved at the very beginning of a graph execution so their values cannot be set “in the middle of your data transformations”. Generally speaking, you can either build the whole SOQL query beforehand and then, just feed it to a child job via a single parameter (e.g. ${SOQL_QUERY}) or you can parametrize just the last part of it (as you indicated in your example) so it would look something like this: Select FIELDS(ALL) From Account WHERE Id in ${PARENT_ID_CSV}.

Note that you can take the approach of wrapping up the SalesforceReader in a subgraph and map the dictionary content to the ${PARENT_ID_CSV} parameter. This way, you can work with the retrieved SF records further down the pipeline. In theory though, you can use ExecuteGraph approach too which might make other things easier for you.

Cheers,

-Vladi