One Star

[resolved] Set Global Variable Dynamically

Hi,
I want to set global variable in my job. The value of variable should be equal to value received from tMap Component. 
How to do this?
1 ACCEPTED SOLUTION

Accepted Solutions
Seventeen Stars

Re: [resolved] Set Global Variable Dynamically

hi all,
what data are you store in your globlaMap ?
because as you iterate on 'list file' you already some information in global var (globalMap) managed by Talend.
@see outline (on left menu at bottom repository by default)
On the other hand, you're using a tJava component and use a flow from it. it couldn't work as tJava cannot manage flow.
And be aware that as you iterate, if you store value in the same global var (set global var) you 'll only got the last value of iteration.
regards
laurent

5 REPLIES
One Star

Re: [resolved] Set Global Variable Dynamically

In the value field use following: Set_FileName.column_name
Seventeen Stars

Re: [resolved] Set Global Variable Dynamically

hi all,
what data are you store in your globlaMap ?
because as you iterate on 'list file' you already some information in global var (globalMap) managed by Talend.
@see outline (on left menu at bottom repository by default)
On the other hand, you're using a tJava component and use a flow from it. it couldn't work as tJava cannot manage flow.
And be aware that as you iterate, if you store value in the same global var (set global var) you 'll only got the last value of iteration.
regards
laurent

Moderator

Re: [resolved] Set Global Variable Dynamically

Hi ksultania,
Would you mind giving us more description about your current use case?
Elaborating your case with an example with input and expected output values will be preferred.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Set Global Variable Dynamically

Thanks! Resolved the issue.
Seventeen Stars

Re: [resolved] Set Global Variable Dynamically

great,
Can you give more information about your issue for Talend community.
And set topic as resolved
Thanks
regards
laurent