How to Reference Form Field Variables in mail-send Process

I am new to Camunda and am trying to figure out how to use form fields from a start event and use them to send an email to the email address entered in one of those fields. I have the mail-send connector setup and can send myself a test email. To try and test this I created a model with one form field which has an id of email. Then I created a service task and used the mail-send connector. For the input fields I used what is shown below for the to field but I get the error that it cannot resolve the identifier. How do I reference the form field email for my “to” portion of my email to send?

What is your model file, can you attach it with the exact error message?

Hi Shamil,

Thanks for your willingness to help me.

Attached is my model.

test3.bpmn (2.8 KB)

Hi @withnoe,

As the service task is the 1’st task following the start event then, execution of both start event and service task would be run in the same transaction which means the process variables would not be available when token reaches the service task.

Try to set asyncBefore=“true” on the service task to create transaction boundaries & let process variables get persisted before token reaches the service task.

<serviceTask id="service1" name="" camunda:asyncBefore="true" />

1 Like

Hi Hassang,

Thank you so much for help! Something so easy to miss.