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: 
jerownimow
Contributor III
Contributor III

Dynamic Filename in tAdvancedFileOutputXML - next iterations returns null from variables

Hi Folks,

 

Here's my code:

0683p000009M0uC.png

And I have two problems:

  1. On the first flow, the first iteration returns null for the variable that will be used on the dynamic filename.
  2. On the second flow, the variables will be used on the other XML output so that it will be one file, the problem is, the filename which is stored in context will already be replaced when the other XML files will be generated.

For the first flow:

Inside tmap I have the ff. fields:

0683p000009M0uH.png    

Inside tJava: context.Filename_Suffix = AssetDocusignTags.Filename_Suffix;
tJavaRow is only pass thru, 

and on tAdvancedFileOutputXML, I have the File Name parameter as:

 

context.directory+"File_"+context.Filename_Suffix+".xml"

what is happening is that on the first file the context.Filename_Suffix returns blank, second file has the supposed to be suffix of the first. But when I print the context it returns as expected which is why I wondered why it doesn't work

Example:

--Current:
file1: filename_.xml /*appears to be null*/ 
file2: filename_geronimo.xml
--Expected:
file1: filename_geronimo.xml
file2: filename_ronima.xml

the content is correct but the dynamic filename isn't. so basically, the expected output should be 1 xml file per row. After the creation of the file for the first row, then the next row should be processed and create an xml file consequently.

 

For the second flow, I have only one field which is a parameter to be used on tRestClient, the problem is on the other 3 tAdvancedFileOutputXML.

 

How can I handle the synchronous assigning of variables on those files so that they will append? With the current design, what had set last on the context variable will be the one to be fetched on the second order of the tMap.

Hoping for your immediate response. Your help will be very much appreciated! Thank you!

 

 

 

Labels (7)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

Output component initialized before tMap and tJava, so when full filename prepared - suffix is really null

 

solution - tFlowToIterate connected by trigger OnComponentOk to next subjob

 

thiw will use already prepared dynamic name for each iteration, and output component would be initialized each iteration with new filename

 

 

View solution in original post

2 Replies
vapukov
Master II
Master II

Output component initialized before tMap and tJava, so when full filename prepared - suffix is really null

 

solution - tFlowToIterate connected by trigger OnComponentOk to next subjob

 

thiw will use already prepared dynamic name for each iteration, and output component would be initialized each iteration with new filename

 

 

jerownimow
Contributor III
Contributor III
Author

Thanks vapukov!