Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Could you explain with some example what is happening.
Also , try to use tJavaFlex instead of tJavaFlow .
@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 ?
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