Obtaining only required variables

Please tell me, how can I request from the current task only the required variables in the current step?

Hi @ntdim1973

If you are using embedded forms then you can use the available built-in variable camForm as follow

var taskService = camForm.client.resource('task');
taskService.get(camForm.taskId, function(err, task) {
    	switch(task.taskDefinitionKey) {
      		case "<task01>":
        		break;
      		case "<task02>":
        		break;
    	}
});

https://docs.camunda.org/manual/7.4/reference/embedded-forms/javascript/api/#camform

Based on the value of task.taskDefinitionKey, you can disable/enable needed fields or do whatever you need.

1 Like