cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reference a variable defined by a Script task, in a custom JavaScript on a form, in an event handler (such as formRendered)?

lepoo
Champ in-the-making
Champ in-the-making

How can I reference a variable defined by a Script task, in a custom JavaScript on a form, in an event handler (such as formRendered)?

2 REPLIES 2

bhchemss
Star Contributor
Star Contributor

Hi,

the custom JavaScript in a form has only access to the fields inside that form and you don't have any access to the process variables there.

cjose
Elite Collaborator
Elite Collaborator

It is best to get them using the REST APIs (/activiti-app/app/rest/process-instances/{processInstanceId}/historic-variables – this api can be used if you are using OOTB UI and will return all variables associated with the process).