Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create a list of string from tlogRow and use it in a query

Hello Community,

 

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)

0683p000009LrWK.png
In the tlogrow i get my IDs, same as in the tfileoutput now in the second ContentVersion i want to request on those ids.

0683p000009LrWP.png

 

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


 

Labels (1)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,

Add a tJavaRow after your tFileOutputDelimited to construct a global variable with the list if ids.

Then you'll be able to reuse this global variable in your next tSalesforceInput component.

Hope this helps.

View solution in original post

4 Replies
TRF
Champion II
Champion II

Hi,

Add a tJavaRow after your tFileOutputDelimited to construct a global variable with the list if ids.

Then you'll be able to reuse this global variable in your next tSalesforceInput component.

Hope this helps.

Anonymous
Not applicable
Author

 

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

 

cheers


Capture.JPG
Anonymous
Not applicable
Author

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)0683p000009LrR3.png

 

I just want test2 (which is my global variable) to be a list of string. Is it possible to do that?

TRF
Champion II
Champion II

Hi,

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!