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: 
Anonymous
Not applicable

How to get Context Group name in Talend

As per my requirement i have added 2 context groups in my job. Attached is the screenshot of my job.

Context group names are DBConnection and SourceConnection.

My requirement is to get those group names and display on console. Is there any way to get Only context group names in Talend?

Please help me.

Labels (2)
7 Replies
TRF
Champion II
Champion II

I'm afraid this is not possible.

As far as I know, context groups are here just to let you organize context variables into the Studio.

billimmer
Creator III
Creator III

As a workaround you could make another context group called "ContextGroups", with a variable called "ContextGroupsList".  You could put your context group names in the list and then display the list on the console.

Anonymous
Not applicable
Author

Thank you bilimmer. I will try to implement your approach.

Anonymous
Not applicable
Author

Hi All,

 

Is there any other approach to get context group name.

 

Please help me.

 

Thanks,

Divya

billimmer
Creator III
Creator III

As TRF said, no but maybe you could prefix your context variable names with the name of the context group?  Like:

 

Context group DBConnection

DBConnection_dbName

DBConnection_dbUser

DBConnection_...

 

Context group SourceConnection

SourceConnection_ip

SourceConnection_url

SourceConnection_...

 

This would work as you can use java reflection to read your variable names, and strip everything after the first underscore...

Anonymous
Not applicable
Author

Thanks bilimmer. Instead of updating context variable names Is it possible to dynamically get the group name?

 

 

billimmer
Creator III
Creator III

No.  But you really have me curious about the use case here.  What are you trying to do?  What purpose does printing the context group names in the console serve?  With more information we could suggest another approach?