Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
rpernas1618300500
Contributor II
Contributor II

Salesforce Dynamic SOQL from list of values from a previous query.

I am trying to link 2 queries and the second query would be dynamic based on a list of values from a previous query.

Having the object A, we do a query on it. I need to create a list with the values of a field of each of the results of this first query. With that list, I need to perform the second query dynamically. How can I do it? The idea I have is, with a tJava, to try to go through the list of results of the first query to save it in a list in globalMap and use it in "Manual query" in the second query.

The problem is that I don't know how to access the rows returned by the first query from the tJava. Would anyone know how I can access those records or if there is a better way to do it?

Thank you very much!!!

Labels (3)
1 Solution

Accepted Solutions
MS5
Contributor III
Contributor III

Hello,

 

To create your list, you can use tAggregatorRow : in Operations tab, add you column and select Function "list". By default delimiter of your list will be "," but you can change it in the Advanced Settings tab of the component.

Then you store your list in a globalVar and you can use it easily in the SOQL editor of your salesforce component.

 

Best regards,

View solution in original post

1 Reply
MS5
Contributor III
Contributor III

Hello,

 

To create your list, you can use tAggregatorRow : in Operations tab, add you column and select Function "list". By default delimiter of your list will be "," but you can change it in the Advanced Settings tab of the component.

Then you store your list in a globalVar and you can use it easily in the SOQL editor of your salesforce component.

 

Best regards,