Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello , i want to create a tfileOutputRaw after each api call to store the response in the file
here is my job design :
I thought that when in my file name i just put TalendDate.getDate("yyyy-MM-dd-HHmmss") to get different files with each api response but the problem is that i get only the last api response
How to get different files for each api response .
Hi @not specified not specified,
I think you may be nearly there with this. Try placing a tFlowToIterate between the tJavaRow and the tRestClient. The instructions for the tFlowToIterate are here: https://help.talend.com/r/en-US/7.3/orchestration/tflowtoiterate
Then after the tFlowToIterate, connect a tIterateToFlow. The instructions are found here: https://help.talend.com/r/en-US/7.3/orchestration/titeratetoflow
In the tIterateToFlow component you will need to recreate each of the columns that are fed to the tFlowToIterate. So if your tJavaRow outputs 3 columns called....
"Column1"
"Column2"
"Column3"
.... you will need to recreate those in tIterateToFlow and populate the columns with the values that are temporarily stored in the globalMap by the tFlowToIterate. If they are all Strings, the columns in the tIterateToFlow will look something like this....
((String)globalMap.get("row13.Column1"))
((String)globalMap.get("row13.Column2"))
((String)globalMap.get("row13.Column3"))
Notice the format of the globalMap.get "key". It is the name of the row feeding the tFlowToIterate, a full stop and the name of the column. The globalMap get requests must be cast to the type of column.