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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
JFournier1632810800
Contributor II
Contributor II

Retrieve data from a previous output on iteration

Hello

In my job bellow, I use row15.customer_number to change part of tRest API url on every iteration. Row15 provide me an internal id as well that I want to use for injecting customer datas with internal id linked to it. I tried to use buffer and tJoin to get the datas but It's not working. I get datas from customer but all internal datas from row15 are NULL.

0695b00000nQSpAAAW.png

Do you have an idea on how to proceed on such case ?

Regards

Labels (2)
1 Solution

Accepted Solutions
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Jean-Baptiste Fournier​ 

 

Based on the information you provided, I understood that you are using the "customer_number" to initiate an API call through the tREST component and after receiving the API response, you need an additional column from the same "row15" record from which the "customer_number" column originated.

 

If this is indeed the scenario, and you're utilizing the "use the default (key/value) in global variables" setting in the tFlowToIterate_3 component, the internal ID column for the current record will also be automatically stored in a global variable. This enables you to retrieve its value using a tJavaRow component, instead of using tJoin and tBufferInput components.

 

Suppose you have "customer_id" and "internal_id" columns from row15, both being of type String.

In the tREST component, you're likely employing something similar to ((String)globalMap.get("row15.customer_id")) to invoke the API and let's assume you receive a "result" column from the API response.

 

By replacing tJoin_1 component with a tJavaRow, you could use something like the following to get the internal_id back into the flow:

 

output_row.result = input_row.result;

output_row.internal_id = ((String)globalMap.get("row15.internal_id"));

 

 

View solution in original post

2 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Jean-Baptiste Fournier​ 

 

Based on the information you provided, I understood that you are using the "customer_number" to initiate an API call through the tREST component and after receiving the API response, you need an additional column from the same "row15" record from which the "customer_number" column originated.

 

If this is indeed the scenario, and you're utilizing the "use the default (key/value) in global variables" setting in the tFlowToIterate_3 component, the internal ID column for the current record will also be automatically stored in a global variable. This enables you to retrieve its value using a tJavaRow component, instead of using tJoin and tBufferInput components.

 

Suppose you have "customer_id" and "internal_id" columns from row15, both being of type String.

In the tREST component, you're likely employing something similar to ((String)globalMap.get("row15.customer_id")) to invoke the API and let's assume you receive a "result" column from the API response.

 

By replacing tJoin_1 component with a tJavaRow, you could use something like the following to get the internal_id back into the flow:

 

output_row.result = input_row.result;

output_row.internal_id = ((String)globalMap.get("row15.internal_id"));

 

 

JFournier1632810800
Contributor II
Contributor II
Author

Hello,

 

Thanks for the answer that's excatly what I was looking for. I should have think about tJavarow but I'm not very familiar with this componement for now.

 

Anyway It's work now and It's more effecient.

 

Regards