Skip to main content

Microsoft Dynamics 365ProNew in 5.16+

Create Leads, Accounts, and Contacts in Microsoft Dynamics 365 from Freeform submissions using the Dataverse Web API. Link a new Contact to an existing Account or to one created from the same submission.

This integration requires Freeform Pro and a Dynamics 365 commercial cloud environment with the applicable tables installed.

Setup Instructions

Create the Microsoft connection

Microsoft Entra ID gives Freeform its app identity. Microsoft Dataverse stores the Leads, Accounts, and Contacts used by Dynamics 365 Sales. Ask your Microsoft or Dynamics administrator to complete these steps in your existing tenant and Sales environment.

1

In Microsoft Entra ID → App registrations, create a registration for Freeform. Select Accounts in this organizational directory only. This server-to-server connection does not need a redirect URI or interactive user sign-in.

2

Copy the Application (client) ID and Directory (tenant) ID from the registration overview.

3

Under Certificates & secrets, create a client secret. Copy its Value, not its ID, before leaving the page. Record the expiry date so the secret can be replaced before it expires.

4

In the Power Platform admin center, select the Dynamics environment and go to Settings → Users + permissions → Security roles. Create a dedicated role for the integration. In the role editor, choose Show all tables if needed.

TablePrivilegesAccess level
Lead, Account, and Contact, for the record types you mapCreate, ReadUser
Entity, Attribute, and Relationship EntityReadOrganization

Some environments call Attribute the Field table and Relationship Entity the Relationship table. These permissions let Freeform discover the field schema. Secured fields and custom logic may require additional access.

To link a Contact, also grant Append on Contact and Read and Append To on the Account. User access covers records the application user owns. For an existing Account owned by someone else, grant access at the narrowest scope that reaches that record.

5

Go to Settings → Users + permissions → Application users and select New app user → Add an app. Choose the Entra registration, select its business unit, and assign the dedicated role. Verify that the application user appears as Active.

6

Copy the environment URL, such as https://yourorg.crm.dynamics.com. Regional hosts such as https://yourorg.crm4.dynamics.com and the corresponding .api.crm4.dynamics.com host are supported. Do not include /api/data/v9.2 or other paths.

7

In Freeform → Integrations → CRM, create an MS Dynamics 365 integration. Enter the environment URL, tenant ID, client ID, and client secret value. Select Save, then Authorize.

All four connection settings support environment variables. The client secret is stored using Freeform's encrypted-setting support. Use the same environment host for authentication and API access. Credentials are obtained using OAuth client credentials; no delegated user_impersonation permission or refresh token is required for this flow.

Microsoft's server-to-server setup guide and application user guide provide additional setup details. A successful connection check verifies the application identity, not permission to create every record or populate every field.

Configure the Form

1

Open the form's Integrations tab and enable the Dynamics integration.

2

Enable Map to Leads, Map to Accounts, and Map to Contacts as needed.

3

Map the appropriate fields. Supported writable standard and custom fields are loaded automatically from the selected environment. Use Refresh after changing Dynamics fields or choices.

4

Map Account Name (name) when creating an Account. Common Lead and Contact fields include firstname, lastname, emailaddress1, and the Lead topic (subject). Freeform shows the requirements reported by Dynamics. Custom business logic may require additional fields.

5

Configure Freeform's integration rules if records should only be sent for certain submissions, such as when an opt-in checkbox is selected.

The integration creates a new record for each enabled category with a nonempty mapping. Leads remain independent of Accounts and Contacts. Submit a test through the published form and confirm the records in Dynamics.

Under Contacts → Contact Company, choose how Freeform should link the new Contact.

OptionBehavior
No AccountCreates a standalone Contact.
Existing AccountLinks to the Account whose GUID you enter in Existing Account ID.
Account Created by This SubmissionLinks to the Account created through Map to Accounts for the same submission. Map Account Name so the form can create that Account.

Check the Contact’s Company field in Dynamics to verify the link. To send multiple Contacts to the same company, use the existing Account ID.

Duplicates and Errors

The integration asks Dynamics to apply its configured duplicate-detection rules. If Dynamics reports a duplicate, the integration reports an error; it does not update, merge or silently skip the existing record. Duplicate detection must be enabled with applicable published rules in the customer's environment. Without those rules, repeated submissions can create additional records.

API failures use Freeform's normal integration error handling and logs. A missing field, insufficient permission, invalid choice, expired secret, or custom validation rule can prevent creation. Refresh field mappings after changing the Dynamics schema. Authentication errors include Microsoft's numeric AADSTS code when available, without logging the token request or client secret.

Freeform sends the Lead, Account, and Contact as separate requests, in that order. A failed write stops the remaining requests. Earlier successful records stay in Dynamics. If the Contact requires a newly created Account, Freeform needs the Account ID from Dynamics before sending the Contact.

Recover a failed delivery

1

Find the affected submission and inspect the Integrations Log. For future submissions, Freeform → Settings → Logging → Classic Logging at Info level records each attempted write and the record ID when Dynamics returns it.

2

Check Dynamics for each mapped record type. Use the record ID when available. A timeout or server error can occur after Dynamics creates a record.

3

Resolve the original error and create only the missing record in Dynamics. Resending the full submission can create duplicates. Freeform leaves retries to the site administrator.

Field Values

Dynamics fieldSupported value
Text, email, phone, URL, multiline textText. Multiple Freeform values are joined with commas.
Whole numberAn integer, including zero or negative values.
Decimal or floating pointA number with a dot as its decimal separator, without currency symbols or thousands separators.
Yes/NoA checkbox or true/false, 1/0, yes/no, on/off. An empty value is false.
ChoiceThe underlying numeric option value, not the display label. Options are fetched from Dynamics.
Multiple choicesAn array of numeric option values, or comma-separated numeric values.
Date Only behaviorA Freeform Date & Time field or a YYYY-MM-DD value. The calendar date is preserved.
User Local date/time behaviorA Freeform Date & Time field or an ISO 8601 timestamp with an offset, such as 2026-09-16T14:30:00-05:00.

Use Dynamics option values as the values of corresponding Freeform options. For example, a choice labeled Website may have an underlying value of 100000002; map that number. Blank values are omitted, except Yes/No fields, which send false. Zero and negative numbers are preserved. Dynamics validates field lengths, numeric ranges, permissions, and its own business logic.

Field mapping supports writable fields for the Lead, Account, and Contact tables. It excludes read-only and calculated fields, general lookups, owners, state/status, currency, large integers, files/images, and Time Zone Independent dates. Use Contact Company for the Contact-to-Account relationship. Custom tables, Opportunities, updates to existing records, on-premises Dynamics, Business Central, Finance and Operations, and sovereign clouds are outside the supported scope.


Does your project require something else?   Contact Us