Event Registration to Salesforce Lead Upsert
Salesforce action: UpsertRecordByExternalID. When a registration form is submitted, upserts a Lead in Salesforce using email as the external ID — creating new leads or updating existing ones — then sends a confirmation email to the registrant.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow automates event registration processing by connecting Microsoft Forms to Salesforce. When an attendee submits a registration form, the flow upserts a Lead record in Salesforce using the registrant's email as the external ID — creating a new Lead if one doesn't exist, or updating the existing Lead if it does. After the upsert, a branded confirmation email is sent to the registrant.
Salesforce Action: UpsertRecordByExternalID (connector operationId: PatchItemByExternalIdV2)
Use Case
Marketing and Sales teams running events (conferences, webinars, product launches) need a seamless pipeline from registration to CRM. This flow eliminates manual data entry, prevents duplicate Leads, and ensures every registrant receives an immediate confirmation — all without writing code.
Flow Architecture
Trigger
When a new response is submittedMicrosoft Forms — Fires when a registrant completes the event registration form.
Step 1
Get Form Response DetailsMicrosoft Forms — Retrieves the full response (name, email, company, title) using the response ID from the trigger. Runs in parallel with steps 2a–2d.
Step 2a
Initialize varEventNameVariable — Loads the event name from the `flowlibs_EventName` environment variable. Runs in parallel with step 1 and steps 2b–2d.
Step 2b
Initialize varLeadSourceVariable — Sets the Lead source to "Event Registration" (configurable). Runs in parallel with the other Initialize variable actions.
Step 2c
Initialize varExternalIdFieldVariable — Loads the external ID field name from the `flowlibs_SalesforceLeadExternalIdField` env var. Runs in parallel with the other Initialize variable actions.
Step 2d
Initialize varLeadStatusVariable — Loads the Lead status from the `flowlibs_SalesforceLeadStatus` env var. Runs in parallel with the other Initialize variable actions.
Step 3
Upsert Lead in SalesforceSalesforce — Uses `PatchItemByExternalIdV2` to upsert a Lead by email. Maps: FirstName, LastName, Email, Company, Title, LeadSource, Status, Description. Waits for steps 1 and 2a–2d to complete.
Step 4
Send Confirmation Email to RegistrantOffice 365 Outlook — Sends an HTML confirmation email to the registrant with event name and registration date.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_FormID | String | <configure> | The Microsoft Forms form ID (GUID) for the registration form. Replace with your form's GUID. |
| flowlibs_SalesforceLeadExternalIdField | String | The Salesforce Lead field used as the external ID for upsert. | |
| flowlibs_SalesforceLeadStatus | String | Open - Not Contacted | The status assigned to new/updated Leads. |
| flowlibs_EventName | String | FlowLibs Annual Conference 2026 | The event name used in confirmation emails and Lead descriptions. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Forms | shared_microsoftforms | When a new response is submitted (trigger) Get Form Response Details |
| Salesforce | shared_salesforce | PatchItemByExternalIdV2 (Upsert Lead) |
| Office 365 Outlook | shared_office365 | Send an email (V2) (Confirmation email to registrant) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Create the registration form
- Create a Microsoft Forms registration form with fields for First Name, Last Name, Email, Company, and Job Title.
- Set the Form ID
- Update flowlibs_FormID with your form's GUID.
- Set the Event Name
- Update flowlibs_EventName with your event's name (used in the confirmation email body and the Lead description).
- Map form question IDs
- In the "Upsert Lead in Salesforce" action, replace the placeholder body/r... references with your form's actual question response IDs for First Name, Last Name, Email, Company, and Job Title.
- Authorize connections
- Open the flow in the designer and authorize the Microsoft Forms, Salesforce, and Office 365 Outlook connections.
- Configure the external ID field (optional)
- If your Salesforce org uses a custom external ID field on Lead instead of Email, update flowlibs_SalesforceLeadExternalIdField to match.
- Turn on the flow
- Change the flow state from Stopped to On.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01External ID value
Uses the form responder's email as the upsert key for the Salesforce Lead.
EXPR.02Lead Description
Timestamps the registration in the Lead's Description field.
EXPR.03LastName fallback
Falls back to the responder's email if Last Name is empty so the Salesforce upsert never fails on a required field.
EXPR.04Company fallback
Defaults Company to "Unknown" when the registrant leaves the field blank.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.