How to pass form field data to subsequent user task activity

I have a form at start event (Approval Request Received) where I am receiving email address of requestor.
I want to send email to requestor and approver through Sent email to support user task where java code is configured as task listener to send email.

Hey @Ashish_Srivastava!
Welcome to the Camunda Community :partying_face:

So let me get this right first - You start off your process using a form and you want to access the variables from there in another user task which comes right after?

If this is the case:
In the form (you start with) you must have specified something like an “ID”, “Label” and “type” right?
If submitted, a variable with the name and of type is being created. You can display it in a subsequent user task by simply adding a field containing the same . This should be everything you need.

P.S.: Take a look into Cockpit after you have started your processes. That’s a really good source for troubleshooting the process. :slight_smile:

Hopefully this was helpful to you!

Thanks Hafflgav.

I am also thinking the same to pass by reference but my problem is I am new to Camunda and syntax so in User input where I need to pass it and what is the syntax? because in task list it is waiting to take input and then execute the java code.

This is what it should look like when using a “Generated Task Form”.


If you want to access a variable from your Java Delegate you would do so via:

delegateExecution.getVariable("email-address"); 

By the way, I would recommend using the external task pattern since it is more future proof. Especially considering that you migrate to C8 at some point in time.

Thanks Hafflgav. I am able to send email through external service

Hi Hafflfav,

I want to suspend the process to next suppose some time before ends so another application will get the input from camunda process.

If the process is end then is there any way to get the defined variable values of it by passing process instance ID?

Do you know how we can do it?