I am using Talend to transfert data from one salesforce organization to another one.
Due to salesforce limitations i need to insert an object and use the recently inserted IDs to request the auto-gerated fields created on the records during the insertion.
I managed to get the inserted Ids but i'm stuck on making them into a list that i can use in a query after that. (my job below)
In the tlogrow i get my IDs, same as in the tfileoutput now in the second ContentVersion i want to request on those ids.
The result of this query on salesforce is :"Select id ContentDocumentId FROM ContentVersion where id in (null)"
I would like this null to be the list of id i get in the tlogrow or tfileoutputDelimited.
Is is possible?
Thanks in advance
Solved! Go to Solution.
In My opinion you could use a tReplicate in order to split one flow to multiple flows...
flow n° 1 to create the first file
flow n°2 to query and than write the second file
Thanks! That's it, i used a tjavarow with a global variable, then used it in my TSalesforceInput component.
That works fine, but i still have an issue:
my tJavaRow create a String with all the IDs.
I would like to create a list of string as variable (in order to bypass the limit for SOQL query in my tsalesforceinput).
Here is my tjavarow (with the end of the job, i used tHashinput/output but that's not a issue here)
I just want test2 (which is my global variable) to be a list of string. Is it possible to do that?
Yes, you may create a list (or an array) of strings in the tJavaRow.
In this case, you'll have to iterate over the list (or the array).
Consider the following representation of your list:
"'id001','id002',...,'id00n'" "'id011','id012',...,'id01n'" ... "'id101','id102',...,'id10n'"
Using a tLoop component you'll call your tSalesforceOutput for each member of the list, and that's it!
Don't forget to mark your case solved if it is.
Kudos also accepted!
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Part 2 of a series on Context Variables
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema