Retrieve delivery code from javascript in a workflow? | Community
Skip to main content
Level 4
March 19, 2021
Solved

Retrieve delivery code from javascript in a workflow?

  • March 19, 2021
  • 1 reply
  • 2109 views

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: 



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 🙂 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by akashaj7696

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

1 reply

akashaj7696
akashaj7696Accepted solution
Level 3
March 21, 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

SorenDPAuthor
Level 4
March 22, 2021
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?