Retrieve delivery code from javascript in a workflow?

Avatar

Avatar

SorenDahl

Avatar

SorenDahl

SorenDahl

19-03-2021

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 🙂 

 

delivery javascript js workflow

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

akashaj7696

Avatar

akashaj7696

akashaj7696

21-03-2021

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

Answers (0)