Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gpinumalla
Creator
Creator

to use tjavarow and pass context variable fron input row and create a file name with use the context variable .

Hi All, I was using the trestAPi and got the result using trest component and passing the context variable from tjavarow. After passing from tjavarow , I wanted to load the context variable to tfileoutputjson name . somehow the sequence is missing, the file names which comes in is coming in from the previous value of context variable to the actual context variable.

trest --> treplicate --> tjavarow --> tfileoutputjson.

Any idea is to fix?

Labels (3)
3 Replies
Prakhar1
Creator III
Creator III

Could you explain with some example what is happening.

Also , try to use tJavaFlex instead of tJavaFlow .

gpinumalla
Creator
Creator
Author

@prakhar dubey. I am getting a response from a rest api . ​ I was using that response with tjavarow to assign a value for the context variable in the current iteration. I wanted to use that value from current iteration to use as json file label name . Is it possible with tjavaflex instead of tjavarow like this :

 

if (input_row.Year== null)

{

output_row.Year=context.year;  // which will pick the value in context instead of input record

}

else

{

 

output_row.Year=input_row.Year;

}

 

context.year=input_row.Year; //update value of context which will be used for next row

 

so the updated value is picking for the next iteration value. is there a way to pick as value and context variable in the current iteration ?

David_Beaty
Specialist
Specialist

Hi,

 

When the flow starts, from the tRest.......tFileOutputJSON whatever the current value of the context variable is used, you can't directly manipulate the file name to use in a single flow. Try something like:

 

tRest -> tReplicate -> tJavaRow -> tFlowToIterate -> tFixedFlowInput -> tFileOutputJSON.

 

This way the file output filename will ne evaluated when the iterate fires, by which time, you'll already have your filename to use in the context variable.

 

Thanks

 

David

 

If these answers are useful, don't forget to give Kudos