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

Referencing a local variable in a workflow in a script

Avatar

Level 1

Hi,
I am wondering if it is possible to call a local variable created within a workflow inside a script to create a condition. I know that a script can reference an attribute from a data schema and recognize its value, which you can use to create a condition, but am not sure if the workflow will function the same if it was a local variable that was created under its properties. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @ryancang 

 

You can define a variable by vars.VARIABLE_NAME command and then use it anywhere in your WF.


     Manoj
     Find me on LinkedIn

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @ryancang 

 

You can define a variable by vars.VARIABLE_NAME command and then use it anywhere in your WF.


     Manoj
     Find me on LinkedIn

Avatar

Level 2

Just a lil addition - if you want to use the variable within a split or something like that, you'd just have to use the following syntax in the expression editor: 

ffb578a4-625f-4498-a5fc-453ad056345c.png

 

 

$ - This is a string type value to be returned from the variable
() - The info we are looking for
vars - We’re looking at an event variable
/@{name} - The variable

The above info is for a event variable - if you wanted to access an instance variable, you’d just look at something like $(instance/vars/@variable)

If you want the returned variable to be in a different format, you’d change the $ to:

$long

$float

$boolean

$datetime


I'm referencing largely the top of this campaign standard page, but it works the same in Classic from my testing (please let me know if I'm wrong) :  
https://experienceleague.adobe.com/docs/campaign-standard/using/managing-processes-and-data/calling-...