How to – Create Marketing form submission record through Flow (Power Automate) – Dynamics 365 Marketing


Recently we were exploring the possibility of creating a marketing form submission record through flow/custom code. Here simply creating the marketing form submission record is not enough, for it to be processed by the platform, we need to call the bound action – msdyncrm_UpdateMarketingFormSubmission with Step = Retry. (And it’s all not an officially supported scenario, so be careful)

Below is how the flow looks like

First, we create a form submission record –

After creating the form submission record, we are creating and associating the marketing field submission records with the values that we want to pass for the form – email, first name, and last name in this case.

And then eventually calling the action –msdyncrm_UpdateMarketingFormSubmission to trigger the submission (resubmit) of the form submission record.

On running the flow, we can see the record created with the status as pending.

Within a few seconds, if the input is correct, we can see the status updated as success

and the corresponding contact/lead created or updated.

Hope it helps..

Advertisements

Dataverse | ‘App Opener’ security role


Rajeev Pentyala's avatarRajeev Pentyala – Technical Blog on Power Platform, Azure and AI

App Opener is a new OOB security role comes with the minimum privileges for common tasks available on all the Dataverse Environments.

Its recommended to use the App Opener role for copy and creating new roles.

App Opener is protected and cannot be updated.

The min prv apps use role, available in the Microsoft Download Center to downland will soon be retired and you must use this new predefined security role App Opener.

🙂

View original post

Fixed – Global variables are not allowed in StartScreen (PowerApps / Custom Page)


Recently while working on a custom page we had a requirement to show different screens on the app start based on a choice field in the record. (The custom page was being opened from a button/command on the form)

For the custom page’s App OnStart we were first removing the curly brackets from the recordID parameter passed to set the ContractId variable followed by setting ContractRecord variable using that GUID in the LookUp function.

Below is the JavaScript used to pass the parameters to the custom page (from the command/ribbon button)

Now based on Contract Type optionset field in the Contract record we wanted to show a different screen as the start screen. However, trying to use the Global Variable in the StartScreen function gave us the error – “Global Variables are not allowed in StartScreen”

The solution here was to use the Param recordId to get the record and set the start screen accordingly in the StartScreen instead of ContractRecord global variable.

Also check  – https://debajmecrm.com/how-to-dynamically-show-the-start-screen-of-an-app-in-power-apps-canvas-apps/

Hope it helps..

 

Advertisements

Get environment variables value using JavaScript


Kailash Ramachandran's avatarMy Trial

As application grow, the complexity of managing and maintaining their Dynamics 365 environments increases. With different teams working on different aspects of the system, it becomes challenging to ensure that the right values are used in the right places. One way to address this challenge is to use environment variables.

Environment variables are a feature in Dynamics 365 that allow you to define values once and use them in multiple places throughout the system. This can help you maintain consistency, reduce the risk of errors, and make it easier to update values in the future.

Environment variables has two values, one is the default value and another one is current value. The default value is constant among all the environment which can be moved from one environment to another, whereas the current value is pertained to the environment and can be added at any time.

Now we have the entity…

View original post 128 more words

Using addProperty to dynamically add a custom property to a JSON object – Power Automate


Recently while working on the integration of Facebook Lead Ads with CRM, through Webhooks / Power Automate we had to process the lead data and create lead and contact records.

Below is a sample format in which we’d get the lead data for the FB form having a first name, last name, date of birth, and email fields in it.

Now we want to create an object having name as proprety and value from values like below from the above response, which will make it easy for use to refer in add a new row / update a row Dataverse step.

For this we will be using addProperty function.

Below is our sample flow –

First we are initializing varJSON – string variable with the JSON response

Than intializing the another variable varFieldData as type Object

Parse JSON action using the sample response.

Here we are interested in field_data property

So in the next step, we loop through each field_data, than use addProperty function in Compose to add name and value to the varFieldData object, and use the outputs of compose to set the varFieldData variable.

addProperty function – addProperty(variables(‘myObject’), ‘newProperty’, ‘propertyValue’)

In the next step, we can see the varFieldData and the way we can access the property last_name added to it.

On running the flow we can see the result as expected –

Hope it helps..

Advertisements

Stop / Go live Lead Score Model behavior in Dynamics 365 Marketing


Recently we were writing a plugin on the Lead Score table to update the associated lead with Score and the Grade values.

The plugin was on Update of Lead Score (msdyncrm_leadscore_v2) to update lead when the Score Status = Up to date.

The interesting point we observed here was that when we stop the lead scoring model all the associated lead scoring records get deleted, which was kind of different than the usual behavior of related records, where we expect it to get deactivated/disabled.

On clicking the Stop button on the lead scoring model all the associated lead score records will get deleted.

All lead score records deleted :-

And now as soon as we Go live, the new lead score records get created back.

It starts the process of creating the records immediately.

Hope it helps..

 

Advertisements