Five Stars

Iterate over a "List of value" context variable

Hi,

 

For the momentI use a tForeach to loop over a list of e-mails that I write directly into the component settings : 

 

foreachloop.PNG

 

Instead of doing that, I would rather store them into an array-like context variable. I've seen this "List of value" type so this is what I've done :

 

mails_context.PNG

 

But I can't find a way to iterate over the values of this context variable.

 

Thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Iterate over a "List of value" context variable

Hi
You can store the value in a context variable with string type, like:
email1,email2, email3
In the job, use a tNormalize component to normalize the value to multiple rows, and then iterate each row, eg:
tFixedFlowInput--main--tNormalize--tFlowToIterate--iterate--tPop

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
1 REPLY
Community Manager

Re: Iterate over a "List of value" context variable

Hi
You can store the value in a context variable with string type, like:
email1,email2, email3
In the job, use a tNormalize component to normalize the value to multiple rows, and then iterate each row, eg:
tFixedFlowInput--main--tNormalize--tFlowToIterate--iterate--tPop

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business