Expand my Community achievements bar.

SOLVED

Retrieve delivery code from javascript in a workflow?

Avatar

Level 2

HI There!

I was wondering if it is possible to retrieve the delivery code of a deliveri in a workflow and assign it to a variable and afterwards update a table with the retrieved delivery code? 

I have this: 

SorenDahl_0-1616157825106.png

What I am in doubt of is, how can I retrieve the deliveryCode of the incoming delivery and store it as a variable to use when updating a table later on that we are using for analysing purposes? 

Also, is it even possible to do in a smart way? Would the 2 JS scripts overwrite the variable value in any case? If yes, then I would have to manually set it anyways, and it will not be very smart. 

I hope someone has insights to this  

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hey,
This can be easily done. First open the delivery (i said open and not edit) and in there go to object modification script, where you can write vars.deliveryCode=delivery.deliveryCode. This will create an event variable with name deliveryCode and it will be dynamically updated with the value of the deliveryCode inside the delivery and then this event variable will flow through and can be used later.

Let me know if this is what you were looking for.

Thanks

Akash

View solution in original post

4 Replies

Avatar

Correct answer by
Level 3

Hey,
This can be easily done. First open the delivery (i said open and not edit) and in there go to object modification script, where you can write vars.deliveryCode=delivery.deliveryCode. This will create an event variable with name deliveryCode and it will be dynamically updated with the value of the deliveryCode inside the delivery and then this event variable will flow through and can be used later.

Let me know if this is what you were looking for.

Thanks

Akash

Avatar

Level 2
Thanks @akashaj7696! That is definitely helpful! I can't seem to figure out how to use that defined variable in an enrichment activity step? Any pointers to how to use that defined variable in steps further down the workflow?

Avatar

Level 3
You can click to add a new row in the output column and in the expression editor write $(vars/@deliveryCode).