Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Adding data from one schema to another

Avatar

Level 2

Hi,

 

I'm trying to get some values from one schema and using them update the corresponding columns in another one.

The workflow is built to first look for all records from schema-1 in query and as complementary information I'm passing column with ID. Then, in the next step - Advanced JS code, I use queryDef on temp:query to select ID from previous step and inside the loop for results I run another queryDef - this time I'm trying to get values from schema-2, based on ID selected previously. At the end, in the second loop I'm assigning values as "vars.example_variable". When I run the workflow, I can see that the values can be printed out to the console, however if I add enrichment after JS activity and then I'm trying to peek at data using "Display the target", these columns are empty.

 

What should I do to get the values there?

 

Thanks,

Dominik

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @d-wnuk 

 

not sure why you doing this on mentioned way but to reach event variable in Enrichment node use this:

$(vars/@example_variable)

 

If you are using loop and only one event variable, with each iteration you will overwrite previous value this is why your method look strange. One query node (first schema) an one Update node (second schema) where ID will be reconciliation key will work for you. Just pick columns for update.

 

Regards,

Milan

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @d-wnuk 

 

not sure why you doing this on mentioned way but to reach event variable in Enrichment node use this:

$(vars/@example_variable)

 

If you are using loop and only one event variable, with each iteration you will overwrite previous value this is why your method look strange. One query node (first schema) an one Update node (second schema) where ID will be reconciliation key will work for you. Just pick columns for update.

 

Regards,

Milan