*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***
I wrote about using the new preview (as of time of writing this) feature on Realtime Marketing forms with form capture. This gives you the ability to map submissions from 3rd party forms but still create the new/updated Contact or Lead record in D365. In that post, I wrote about the process of mapping the fields on your other form to fields on your form in the marketing app. That all works great, but what about setting defaults on the record in Dynamics 365 when there is no corresponding field on your external form? This post shows you how to do that.
To get started, review the post Using Form Capture With Realtime Marketing Form Submissions. Then come back here. This is my form built using another 3rd party solution. In order to map the field submissions, I need to have a corresponding field to create or update a Lead record in D365.
However, I also want to set all of these as defaults. Add the fields to your form in D365. No need to hide them as no one will see this form, they will be filling in the one above instead. I’ve picked 4 different type fields so you can see how to handle the mapping of text, two option, choice and lookup fields. Save and make your form live.
Just like in the other blog, you will get your code by clicking on the Form capture option and then copying the code you need.
Assuming you read the other post, you will know you need to adjust the code to fill in details for the mapping. When you were mapping the fields from the 3rd party form, you would add the field name where it shows ***Please fill***. However, in the case of the 4 fields above, there is no field on our 3rd party form, so we need to do something a little different.
If you review the script above, you can see the four fields all expect to have something added to the FormFieldName. However, as there is no field on the 3rd party form, we start by removing that line for each of those unmapped fields. What we need to leave is the DataverseFieldName and then set the DataverseFieldValue. Let’s look at each of the four fields types:
Dataverse Field Name | Type | Dataverse Field Value |
---|---|---|
Purchase Need | Two Options | 0 for No, 1 for Yes |
Lead Source | Choice | Value from the list provided |
Industry | Single Line Text | Text you with to use |
Source Campaign | Lookup | GUID from the record you wish to use |
Here you can see how I updated the script to set the values needed. For the lookup, just make sure you replace the actual ID of a record in place of the ***Please fill** text that was added to the original script you retrieved from your marketing form.
Now once the form is submitted, those four additional fields will have a default value set for each one. Perfect! Hope this helps!
Check out the latest post:
Split Your Audience By Number Or Percentage In Customer Insights - Journeys
This is just 1 of 480 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.
Hi Megan,
do you have any advice to set a default value for multi-select optionsets?
For me it seems there is a different behavior to a normal optionset..
Hi Valentin, you would have to make adjustments in the HTML to do this. If your multi-select is going to be hidden, add it to your form first, then set it as hidden. Then open the HTML, search the the name of the values you want to set and then just add the word checked to the end of the input row. For example, this would be one of the values:
Just simply adjust it like this:
That’s it! That option will then be checked and submitted as a default. Hope that helps!