Creating global variable from external file

Five Stars

Creating global variable from external file

Hi All,

I am new to talend. I am trying to find out the way to create global variables automatically from the external file.

If anyone has already faced this scenario.


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Creating global variable from external file

Suppose you have a CSV file with fields key and value. Connect a tFileInputDelimited to a tSetGlobalVar. Add Aline into the variable array and enter row1.key for the key field and row1.value for the value.
When you will run that job, you have 1 variable for each input file record.

TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: Creating global variable from external file

Suppose you have a CSV file with fields key and value. Connect a tFileInputDelimited to a tSetGlobalVar. Add Aline into the variable array and enter row1.key for the key field and row1.value for the value.
When you will run that job, you have 1 variable for each input file record.

TRF
Moderator

Re: Creating global variable from external file

Hello,

Could you please let us know if this scenario helps?

TalendHelpCenter:Reading data from different MySQL databases using dynamically loaded connection par...

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.
Five Stars

Re: Creating global variable from external file

Hi Sabrina , Thanks for your quick reply. I went through the link but there contextload is being used to export the variable but in my case I am not able to use contextload because I am not able to access context varibale in RUN IF trigger link, but global variables are accessible there, so I am going with global variables. 

Forteen Stars TRF
Forteen Stars

Re: Creating global variable from external file

tContextLoad should work if you want to load context variables - don't know why you can't use a context variable in a If trigger expression.

However, as you were asking for a solution for global variables, my previous answer should help you.


TRF
Six Stars

Re: Creating global variable from external file

i have a job todo this , and run prejob on all job for initialization (cf screens)
Five Stars

Re: Creating global variable from external file

Thanks All for the help, TRF's solution worked out as I am using global variable. I will explore contextload as well, why I am not able to access context variable in run if trigger.  

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.