Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Adding data from one schema to another

d-wnuk
Level 2
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
Milan_Vucetic
Correct answer by
Community Advisor
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
Milan_Vucetic
Correct answer by
Community Advisor
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