How to set formKey like "Camunda:formKey" for particular userTask

actualy i’m getting Formkey for UserTask from the user through modal(i’m not using properties-panel).and i need to set formkey for that perticular userTask

so, what i want is
<bpmn:userTask id=“Task_877xpif” name=“ApproveTask” camunda:formKey=“userFormKey”>

please help me on set camunda:formKey for specific userTask.

Grab the element and update the formKey property. Make sure, you have loaded the Camunda model extension.

const userTask = elementRegistry.get("Activity_1");

modeling.updateProperties(userTask, {
  formKey: "foo"

Full example:

1 Like

thank you. @philippfromme it’s working perfect