Auto-launch submissions with code
Automatically create new submissions on other forms when a workflow step is entered.

Part of this setup has to be done in the Code Builder. You can build the computed field in the visual form editor, but the step that launches the submissions is added on the Workflow tab in the Code Builder.
Overview
When a submission reaches a workflow step you choose, Droplet can automatically:
Create a new submission on each destination form you list
Assign each new submission to a person
Copy data from the original form into the new submissions
Email each assignee so they can pick up the new submission at its Start Step
This is similar to the packet launcher, but it creates separate submissions instead of a grouped packet.
Launching form: the form that triggers the automation (the one you're editing).
Destination form: the form where the new submission is created.
Use cases
This feature is especially useful for:
Parallel reviews: several people review the same information, each on their own submission.
Same data, many people: when HR approves a resignation, IT, Payroll, and the building principal each get their own offboarding submission with the employee's information already filled in.
Follow-up forms: an approved hiring request automatically starts the onboarding form.
Approvals across forms: one form's approval starts the next form's process.
Before you start
You'll need:
The form ID of each destination form
The field IDs of the fields you want to copy, on both the launching form and the destination form
The name and email of each assignee, either typed in or taken from a field on the launching form
Contact your Implementation Manager if you'd like help planning this feature.
Two ways to set it up
The code can live in one of two places. Both work.
| Method | Where the code goes | Best for |
|---|---|---|
| Computed field (recommended) | A computed field on the launching form holds the code. The workflow step points to that field. | Most forms. You can see the result while testing, and the Workflow tab stays short and easy to read. |
| Workflow only | All the code goes on the workflow step. | Quick setups if you're comfortable in the Code Builder. |
Step 1: Add a computed field to the launching form
Add a Computed field to the launching form and give it the ID launchSubmissions. Paste this into its formula, then replace the example form ID and field IDs with your own:
[
{
formId: 'PASTE_DESTINATION_FORM_ID',
assignedTo: {
name: reviewerName,
email: reviewerEmail
},
data: {
employeeName: revieweeName,
requestAmount: budgetAmount,
department: reviewDepartment
}
}
]What each part means
| Part | What it does |
|---|---|
[ ] | Square brackets hold the list of submissions to create. Everything goes inside them. |
{ } | Each set of curly brackets is one new submission. |
formId | The destination form. Keep the single quotes around the ID. |
assignedTo | Who receives the new submission: one name and one email. |
data | Which data to copy. Each line reads destination field: launching form field. |
In the example above, employeeName: revieweeName means "fill the employeeName field on the new submission with whatever is in the revieweeName field on this form."
Typed-in text vs. a field from your form
This is where most setups go wrong:
Typed-in text goes inside single quotes:
name: 'Jane Smith'A field ID has no quotes:
name: reviewerName(this uses whatever was entered in the reviewerName field)
You can mix both. For example, status: 'New' fills a status field on every new submission with the word "New."
Hide the computed field
Users don't need to see this field. Hide it by putting it in a hidden section, or by setting it to hidden in your step permissions. You can still see its value in debug view while testing, so you can confirm the data looks right before you publish.
Step 2: Point the workflow step to the computed field
Open the Code Builder and go to the Workflow tab. Find the step that should launch the new submissions and add this inside it:
"onEnter": {
"createSubmission": "launchSubmissions"
}onEnter means "when the submission arrives at this step." createSubmission tells Droplet to create the submissions listed in your launchSubmissions computed field.
For example, to launch new submissions after the final approval, add it to the completed step:
"completed": {
"status": "completed",
"onEnter": {
"createSubmission": "launchSubmissions"
}
}If the step already has an onEnter (for example, one that assigns the step to someone), don't add a second one. Add createSubmission inside the existing one and separate the two lines with a comma:
"onEnter": {
"assign": { "nameElementId": "principalName", "emailElementId": "principalEmail" },
"createSubmission": "launchSubmissions"
}Create more than one submission
Add another set of curly brackets inside the square brackets, with a comma between them. Each set can go to a different form and a different person:
[
{
formId: 'PASTE_FIRST_FORM_ID',
assignedTo: { name: reviewerName, email: reviewerEmail },
data: { employeeName: revieweeName }
},
{
formId: 'PASTE_SECOND_FORM_ID',
assignedTo: { name: 'Business Office', email: 'businessoffice@district.org' },
data: { employeeName: revieweeName, requestAmount: budgetAmount }
}
]Other option: put all the code in the workflow
You can also skip the computed field and put everything on the Workflow tab, right after the createSubmission key. If you do, the code must be on one line, and because it's wrapped in double quotes, use single quotes inside it:
"onEnter": {
"createSubmission": "[{ formId: 'PASTE_DESTINATION_FORM_ID', assignedTo: { name: reviewerName, email: reviewerEmail }, data: { employeeName: revieweeName } }]"
}If you see a "control character" error when saving, there's a line break inside the quotes. Put the code back on one line, or use the computed field method above.
Troubleshooting
I get a "control character" error when saving.
There's a line break inside quotes on the Workflow tab. Put the code on one line, or move it into a computed field.
The new submission is missing data.
Check that the field IDs are spelled exactly the same, including capital letters, and that the destination form's field is on the left.
Nothing was created.
Check that createSubmission is inside the right workflow step, and that the computed field's ID matches what the workflow step points to.
Email the Droplet support team at support@droplet.io.