The Custom action accepts
When can you use this scripting method?
Use this scripting method if you need to dynamically generate and store content to use somewhere else in the script; for example, to build dynamic date strings for a travel or hotel search.
This method also enables you to access and modify script properties on the step and action levels. The most common scripting scenario is in the case of a conditional step where you tell the agent to ignore certain actions if some condition is met.
Using this method
Instead of entering a window or frame reference as the Target Window, enter
Modifications to the script properties.
If you use the
var keyword when defining a variable within the control scope, it becomes unavailable as soon as the
executeJS function (the custom action) completes. Remove the
var keyword if you need access to the value later on in the script. It is important to keep this in mind if you are using the control scope to define global variables.
To access that variable later on in the script, you can simply reference the variable name if you reference it within another
executeJS; or use the backtick method if you need to insert the value into an action property.
Script, step, and action properties are easily accessible from within the control scope by referencing the element in the JSON model. For example, if you want to access the value of the third action on the second step, write the following: