How to – Hide, Submit and validation in Dynamics 365 Marketing Form


Continuing our previous post on setting hidden field’s value using JavaScript in Embedded Marketing Form,

https://nishantrana.me/2022/11/23/how-to-use-dynamics-365-marketing-javascript-api-to-set-hidden-fields-value/

below are a few more points that could help –

  • To hide the Marketing form on the host page – we can use afterFormRender
  • To submit the Marketing form on the host page –

  • If we are setting a non-existing value for an option set field in the formSubmit event, it will be treated as blank before submission and the blank value will be passed. However if the field is Required then validation will kick in and the form will not get submitted.

Get more details – Extend marketing form using code

Hope it helps..

Advertisements

Fixed – Hide field option missing for dropdown (OptionSet) field in Marketing Form – Dynamics 365 Marketing


Recently while designing the marketing form, we realized the Hide field option missing for our dropdown fields.

There are 2 ways to solve this –

In the HTML designer mode for the Marketing form –

  • Add the attribute hidden=”hidden” for the field

The field will be hidden but the Hide field toggle won’t be available in the designer.

  • Change the data-editorblocktype from “Field-dropdown” to “Field-checkbox“.

This adds the Hide field toggle option in the designer.

The result –

The helpful thread – https://community.dynamics.com/365/marketing/f/dynamics-365-for-marketing-forum/391470/how-do-i-populate-lead-source-from-a-hidden-field-on-marketing-form

Hope it helps..

Advertisements

How to – use Page Personalization in Dynamics 365 Marketing


Page personalization uses cookies stored in the user’s browser for identifying the contact, and then fetches values for the contact record using JavaScript.

For page personalization to work –

  • The domain should be authenticated
  • It must use HTTPS
  • Contact should have Prefilling enabled i.e. Prefill Marketing Form field in the Contact record should have the value Allow.
  • Specify the contact fields to be made available.

Below is the marketing form (landing page) that we’d be using.

The form has a Remember Me element in it required for Personalized Pages. It gets automatically added to the form if we enable PreFill for the form.

https://nishantrana.me/2022/11/16/how-to-enable-prefill-for-marketing-forms/

We have only kept Pre Fill enabled for the City field. The other fields in the form have prefilled disabled.

Create a new personalized page, navigate to Outbound marketing >> Marketing Content >> Personalized Pages and add

Personalized page fields to it

After adding the fields, Click on Go live.

Going live generates the JavaScript
code, that we’d paste into our page, in the <head> section of the HTML.

As we have added 3 Personalized page fields, we will have access to the value of only these 3 fields on the page where this script is used, even though our Marketing form can have multiple fields or even if the cookie has other values stored as part of another marketing form.

Below we have added the JavaScript code in the head section and modified it to fetch the value of 3 fields added and also we have the code for embedding the Marketing form.

Lastly, we have a Div element to show the personalized message to the user.

Below is our page

Let us populate the values and submit the details (with Remember me enabled)

Let us refresh the page after a few seconds. This is because in the background we will have the lead/contact record either created or updated based on what we have specified in the Marketing form.

As expected, we have the div populated with First Name, Last Name, and City details using the Personalized Page’s JavaScript.

Also as we had Pre-fill enabled for only the City field, we can see the value automatically populated for it.

Please referhttps://meganvwalker.com/d365-marketing-personalised-pages-on-your-website/

Get more detailshttps://learn.microsoft.com/en-us/dynamics365/marketing/personalized-page-content

https://learn.microsoft.com/en-us/dynamics365/marketing/personalized-page-content#test-your-page-personalization

Hope it helps..

Advertisements

How to enable prefill for marketing forms


Check the previous posts on hosting marketing forms for more details

How to – embed marketing form on an external page

Here we will see Prefill in action.

https://learn.microsoft.com/en-us/dynamics365/marketing/form-prefill#create-a-landing-page-form-with-prefill-enabled

We have created the below marketing form (type – Landing Page) right now (currently Pre-fill is set as default false for the form/fields)

Submit the form –

We can see the contact / lead records created as part of submission.

The contact has Do not allow for Prefill marketing form field

Opening the website we don’t see any pre-fill information as expected.

Now let us enable prefill for the fields and for the form.

Enabling Prefill for form automatically adds the Remember me element to the form. It is tied to Prefill marketing form field on the contact record as we saw earlier and required for prefilling to work.

Let us submit the form, this time with Remember me as true.

We can see Prefill marketing form field set as Allow for the contact.

Load the marketing form page again and we can see the value already pre-filled or populated for the user.

We saw how we can enable prefilling for Landing Page type form, by enabling prefill as true at form and field level and adding the remember me element.

For form type – Subscription Center, pre-filling is already enabled for all the fields regardless of their prefill setting, and at the form level also it is set as true and the field is read-only.

Here we do not have to add a remember-me element.

Here we must include the Do not email element.

Prefill in the case of subscription form

Hope it helps..

Advertisements

Fixed – change the owner of the Flow or Flow client error returned with the status code “Forbidden” and ConnectionAuthorizationFailed in Power Automate


Recently while trying to change the owner of the workflow we were getting the below error 

Flow client error returned with status code “Forbidden” and details “(“error”:X [“code”: “ConnectionAuthorizationFailed”, “message”: “The caller object id is ‘ffcdd1fc-2858-4019-9a96-19d73ae124c8″. Connection ‘providers/Microsoft.PowerApps/APIs/shared_commondataserviceforapps/connections/shared-commondataser-87229e07-1003-4e05-8172-fdaf112ceb98’ to ‘shared_commondataserviceforapps cannot be used to activate this flow, either because this is not a valid connection or because it is not a connection you have access permission for. Either replace the connection with a valid connection you can access or have the connection owner activate the flow, so the connection is shared with you in the context of this flow.”}}”.

Below are the steps we were following to change the owner of the cloud flow –

https://learn.microsoft.com/en-us/power-automate/change-cloud-flow-owner

Select Edit for the flow, specify the owner and save.


In our case, the owner had left the organization and the user’s record was not available in the CRM. Finally, we managed to change the owner and fix the issue, by assigning the new owner to the corresponding modern flow record through the below steps – 

  • Open Advanced Find
  • Search for Process Type equals Modern Flow


  • Select the flow, click on the Assign Process button and specify the new owner.


This way we were able to change the owner without any error and got the flow working properly.

Hope it helps..

Advertisements

How to – add Contact Insights / Account Insights to the form – Dynamics 365 Marketing


We can see the Account Insights / Contact Insights tab added along with LinkedIn Lead Info on the default lead form (as well as contact/account) after we install Dynamics 365 Marketing.

These tabs will be added if you try creating a new form (Main).

But if we have other existing forms (Main), these tabs won’t be added and won’t be available for us to add.

In that case, we need to edit the Form XML to add these sections.

Here we will be adding the Contact Insights tab to one of the existing forms to the Lead.

Using the Form XML Manager (XrmToolBox plugin – developed by my friend Rasheed), get the Form XML of the form where we have the contact insights tab added.

Copy the below details –

Tab – Contact Insights

And the below controlDescription

Going back to Form XML Manager, select the form where we want to add the contact insight tab, get its Form XML and add the above details and publish.

We can see the Contact Insights tab added

Similarly, we can Account Insights, and the LinkedIn Lead Info tab as well.

Hope it helps..

	<tab name="contactInsights" id="{AC28F8C9-4498-47C7-8D9B-2FE028CFBDAC}" IsUserDefined="0" locklevel="0" showlabel="true" expanded="true" labelid="{6905336d-985b-4137-a106-31b1dd4e1560}">
			<labels>
				<label description="Contact insights" languagecode="1033" />
			</labels>
			<columns>
				<column width="100%">
					<sections>
						<section name="insights_section" showlabel="false" showbar="false" locklevel="0" id="{2328D81F-CA70-4A20-8B62-DA36756DA7D8}" IsUserDefined="0" layout="varwidth" columns="1" labelwidth="115" celllabelalignment="Left" celllabelposition="Left" labelid="{29474d06-89ea-41ad-a999-9d96dd95c938}">
							<labels>
								<label description="Insights" languagecode="1033" />
							</labels>
							<rows>
								<row>
									<cell rowspan="1" id="{37367a00-f45e-4ae4-a4a4-5ba1023fdc11}" colspan="1" labelid="{e971ab6b-ea22-4543-bbd5-06e50f11f9f1}">
										<labels>
											<label description="" languagecode="1033" />
										</labels>
										<control id="msdynmkt-lead-insights-banner-control" classid="{F9A8A302-114E-466A-B582-6771B2AE0D92}" disabled="false" uniqueid="{B93040CC-F97E-48D8-8166-5179C8C942CE}" isunbound="true">
											<parameters />
										</control>
									</cell>
								</row>
								<row>
									<cell id="{58B703D6-BBA5-4078-9499-1D5A1FB35932}" showlabel="false" locklevel="0" labelid="{db0b8895-c098-45e5-b95f-f85df882f96d}">
										<labels>
											<label description="Insights" languagecode="1033" />
										</labels>
										<control id="LeadContactInsightsCtrl" classid="{F9A8A302-114E-466A-B582-6771B2AE0D92}" datafieldname="msdyncrm_insights_placeholder" disabled="false" uniqueid="{ADB58B3F-E8A8-432B-BF8C-08196D8F87ED}" />
									</cell>
								</row>
							</rows>
						</section>
					</sections>
				</column>
			</columns>
		</tab>
	<controlDescription forControl="{ADB58B3F-E8A8-432B-BF8C-08196D8F87ED}">
			<customControl formFactor="0" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadContactInsights</configuration>
				</parameters>
			</customControl>
			<customControl formFactor="1" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadContactInsights</configuration>
				</parameters>
			</customControl>
			<customControl formFactor="2" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadContactInsights</configuration>
				</parameters>
			</customControl>
		</controlDescription>
		<controlDescription forControl="{48D797ED-2F85-4D89-A329-69C2A1A0E1DD}">
			<customControl formFactor="0" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadAccountInsights</configuration>
				</parameters>
			</customControl>
			<customControl formFactor="1" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadAccountInsights</configuration>
				</parameters>
			</customControl>
			<customControl formFactor="2" name="MscrmControls.InsightsControl.InsightsControl">
				<parameters>
					<configuration static="true" type="SingleLine.Text">LeadAccountInsights</configuration>
				</parameters>
			</customControl>
		</controlDescription>
		<controlDescription forControl="{B93040CC-F97E-48D8-8166-5179C8C942CE}">
			<customControl formFactor="0" name="CxpOrchestrationAnalytics.InsightsBannerControl.InsightsBannerControl">
				<parameters />
			</customControl>
			<customControl formFactor="1" name="CxpOrchestrationAnalytics.InsightsBannerControl.InsightsBannerControl">
				<parameters />
			</customControl>
			<customControl formFactor="2" name="CxpOrchestrationAnalytics.InsightsBannerControl.InsightsBannerControl">
				<parameters />
			</customControl>
		</controlDescription>
	</controlDescriptions>
Advertisements
%d bloggers like this: