Skip to content

Working with Related Entities

Gravity Forms Dynamics 365

Lookup columns in Dynamics link one record to another, such as a lead’s Source Campaign or a contact’s Company Name. Dynamics stores the related record’s ID, a GUID, not its name. The Gravity Forms Dynamics CRM Add-On gives you three ways to set a lookup. Only the last one needs a GUID:

Let the visitor choose a record

This example lets the visitor pick the campaign that sets a lead’s Source Campaign.

  1. In the Gravity Forms editor, add a Drop Down field.

  2. In the field’s settings, check Populate from Dynamics.

  3. Set Populate Mode to Lookup (Records).

  4. Choose the Entity Type that has the lookup column, such as lead.

  5. Choose the Lookup Attribute, such as Source Campaign (campaignid). The add-on fills in the choices with active records from the related table. Each choice shows the record’s name and stores its GUID.

  6. Check Keep in Sync with Dynamics to refresh the choices when the form loads.

    A Drop Down field’s settings with Populate from Dynamics set to Lookup (Records) and the Source Campaign lookup attribute selected

  7. In your feed, map the field to the lookup column, such as Source Campaign (CampaignId).

The drop-down shows up to 250 active records, sorted by name. With Keep in Sync on, the add-on caches the records for an hour. Change that under Forms > Settings > Dynamics CRM > Lookup Cache Duration (seconds), or set it to 0 to turn caching off. Refresh Metadata on the same page also clears the cache.

Link every entry to the same campaign or marketing list

For campaigns and marketing lists, the feed has its own settings, so you can pick the record by name.

  1. Open your feed.

  2. Under Campaign Association, check Associate with Campaign and choose the campaign under Campaign Source. The add-on sets the record’s Source Campaign. To read the campaign from the form instead, for example a hidden field filled from a UTM parameter, choose Map to Form Field.

  3. Under Marketing List Membership, check Add to Marketing List(s) and select the lists. Marketing lists need Dynamics 365 Web API version 9.0 or later.

    The feed’s Campaign Association and Marketing List Membership settings with a campaign and a marketing list selected

Link every entry to the same record

For any other lookup, put the record’s GUID in a hidden field. This example links every lead to one parent account.

  1. In Dynamics, open the record. Its GUID is the id value in the browser’s address bar. Copy the part after id=, up to the next & if there is one.

    A Dynamics account record with the id value in the address bar highlighted

  2. In the Gravity Forms editor, add a Hidden field, such as “Parent Account”.

  3. On the field’s Advanced tab, paste the GUID into Default Value.

    A Hidden field with the record’s GUID as its Default Value

  4. In your feed, map the hidden field to the lookup column, such as Parent Account for lead (ParentAccountId).

New entries now link to that record.

Still need help?

Can't find what you're looking for? Send us a message and we'll get back to you.

Contact us