Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
AnnaSchmd
Contributor
Contributor

Can not call a dynamic global variable in another subjob.

I have this job design:

0695b00000rRGfQAAW.png

F

in tSetGlobalVar_1:

0695b00000rRGh2AAG.png

==> Depending on the value of the Month column I will have different key value pair. For example:

For row8.Month = "JAN" I will have Key: "file_name_JAN" and Value: <path>/JAN.csv

In the 3. subjob I would like to use this global variable to create appropriate file.

0695b00000rRGuVAAW.png

But I received a java.lang.NullPointerException in component tFileOutputDelimited_2.

Why could the global variable not be used in the tFileOutputDelimited?

Labels (3)
2 Replies
David_Beaty
Specialist
Specialist

The file name used in the tFileOutputDelimited_2 needs to be set before the flow starts - it can’t be part of the incoming flow. Consider using a tFlowToIterate component.

 

konvertilo
Partner - Contributor III
Partner - Contributor III

Hello

You could use the globalMap to store the name (subjob 2) and retrieve the filename and setting one context with the value you get from the globalMap.get() ?