Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend 6.2.1 Context Variable

Hi,

 

I am trying to create context variable and want to use in tMap to remove hard coding from my talend job. I saw multiple example, everywhere context group has three tabs namely Variable, Value as tree, value as table whereas there is no such tab in my case. PFA screen shot.

0683p000009LuAH.jpg

 

How to create context varaible in Talend 6.2.1 and how we can use them in tMap?

 

Another requirement is to create context variable and store path in it. Read that path from context variable while create metadata of flat file. Is that possible? If yes, how?

Labels (2)
11 Replies
TRF
Champion II
Champion II

Hi,

Hit the + sign at the bottom left to add a context variable then enter name, type and value.

This will populates variable for default context.

Hit the + sign at the upper right to add a new context (corresponding to different execution environment).

Context variable can be used almost everywhere (not only tMap) using "context.myVariable".

 

Context variable are populated at runtime (when job starts). They are not available when defining repository elements.

 

Regards,

cterenzi
Specialist
Specialist

If you want to create a context variable that is local to your job, click the green plus button at the bottom left in your screenshot.  Give the new variable a name, type, and optional comment and default.  To reference the variable in your job, type context.varName (e.g. if your variable is named basePath: context.basePath)

Anonymous
Not applicable
Author

I created metadata using wizard and there we have to select filename with path. Can we use context variable there or is there any way we create automated metadata using context variable?

TRF
Champion II
Champion II

As said, I think you cannot use context variables for this purpose

Anonymous
Not applicable
Author

Can we use context variables while saving output using tFileOutputDelimiter? 

TRF
Champion II
Champion II

As said, context variable can be used almost everywhere (not only tMap) using "context.myVariable".

cterenzi
Specialist
Specialist

Are you asking if you can create a File metadata entry and reference a context variable for the path and filename?

mobmsc2
Creator
Creator

Once the context variable has been created is there a way to "publish" it so it gets listed when you use keystroke Control+spacebar

Anonymous
Not applicable
Author

If you create a local context.variable it will automatically come in template proposals, however when you create a context using the left repository panel you will need to select the newly added context into your context list from repository context