D365 Dialogs functionality using Power Automate: When a record is selected

Most of you probably remember the time when Dialogs was part of Dynamics 365 Processes. When users would run the dialog it allowed for a window to pop up where users could enter data into the dialog. From there the system could perform actions (like workflows and power automate flows do) such as creating a record, updating a record etc.
Unfortunately dialogs were deprecated a while ago. What if you needed to have similar functionality in Dynamics 365 where certain things needed to be entered by a user? I have some good news! Power Automate allows you to do this by selecting a record and then manually running a flow! In this article I am going to show you how you can set this up!

Scenario

There are infinite ways we can use this functionality but for this example I want the sales rep to run the flow on an opportunity record before they go to the next step in the business process flow. The sales rep will need to answer a few questions and upload an NDA document. After that the opportunity can be moved to the next step in the business process flow. I have added a (read only) date field on the opportunity, which is a required step in the business process flow. This field will be populated by the flow after the questions are answered. I have also added a custom field called NDA which is a file type field where I will be storing the NDA.
(NOTE: You probably want to use SharePoint to store documents vs Dynamics 365, but again this is just an example of some of the functionality and options in Power Automate.)
Another thing we could do here is create an entity with the questions and answers, so that we could actually store the data in Dynamics 365, but I am not going to do that for this example.

Configuration

After you logged into flow, you need to click ‘+New Flow’ from the top left of the screen. This will allows you to pick from different options, you can start from a template or build your flow from blank. For this example I am going to pick the instant cloud flow. In the window that comes up I click the ‘skip’ button on the bottom which brings me to the flow configuration window.
The trigger that we’re going to use for this flow is using the ‘common data service’ connector. Yes you heard that right, that is NOT the ‘common data service(current environment)’ connector because the trigger is not available in the ‘common data service(current environment)’ connector. Search for and select the ‘When a record is selected’ trigger.
You’ll notice that you’ll have to select and environment and an entity name for the flow to be triggered on. (Remember this will be a manually triggered flow). I choose ‘Default’ for the environment and I selected ‘Opportunities’ as the entity the flow will run on.
Below the field we just populated you’ll notice the ‘+Add an input’ button’. This is where we can configure fields that will appear on a pop-up window when a user initiates this flow to run. There are several types you can choose from:

  • Text (If you click on the ellipse next to a text field, you’ll be able to add a drop-down or multi-select list of options)
  • Yes/No
  • File
  • Email
  • Number
  • Date

I think the options are pretty self-explanatory, so I am not going to explain each individual option if you don’t mind. For my flow I am going to add two yes/no fields with and I am changing the names of the fields to show ‘NDA Signed’ and ‘Budget Approved’. If you want to make the input field(s) required (or not required) you can click on the ellipse of each individual input field and you’ll see the option to make required (or not) appear.
The next input type is a date field which I am naming ‘Close Date (Est.)’. The input type after that is a ‘File’. This is where sales reps can upload the NDA PDF document. Once the input fields have been created we can move on to the next step.
Click ‘+New Step’ and select ‘Update a record’. I selected the ‘common data service(current environment)’ for this step, but you could also use the ‘common data service’ if you prefer. For the entity name in the step select ‘Opportunities’ and the ‘item ID’ is the unique id of the opportunity from the ‘When a record is selected’ trigger. If you search for ‘unique id’ you should be able to pick it from the dynamic values list. There are a couple of fields I am going to update on the opportunity table.

The first field I am going to update the ‘Est. Close Date’ on the opportunity. I want to set this field to the value that was entered by the sales rep when they launched the flow. Click in the ‘Est. Close Date’ field in the ‘Update a record’ step and search for the name of the input field ‘Close Date (Est.)’ in Dynamic Content window that appears. Click on the ‘Close Date (Est.)’ to enter it in the Est. Close Date field on the opportunity. As mentioned earlier I added a custom date field ‘Questionnaire completed’ which I am going to date stamp it with the date this flow ran. Click on ‘Show advanced options’ and search for the ‘Questionnaire completed’ field, then click your mouse in the field. You’ll see the ‘Dynamic Content’ window open. Click on the ‘Expression’ tab and type in ‘utcNow’.

NOTE: Since I have my date field configured to show the date/time in the users’ time zone, I don’t have to use an expression to convert the time from UTC to a different time zone.

In the next step we’re going to upload the file to the opportunity. As mentioned above, I have created a file type of field to store the attachment. Click ‘+Next Step’ and select ‘Upload file or image content’. (This step is only available with the ‘Common Data Service(current environment)’ connector). Select ‘Opportunities’ as the entity name.

The item ID is the opportunity’s unique identifier which we also used in the ‘update a record’ step. In the field name you need to select the file type field where you want to store the attachment. In the ‘Content’ field you need to select the file that was uploaded by the sales rep. I called the file input ‘Attach NDA PDF’ so that’s what I will be searching for in the dynamic content window. Keep in mind that unfortunately the file extension will not be added when the file is uploaded, so in the content name I typed ‘NDA.pfd’.

NOTE: You could also add an input field and use that as the name, but users would have to add the file extension. (I.E: .pdf, .doc, .xlsx, etc.)

I hope you enjoyed this post! Be sure to check in again next week for a new article or subscribe here to never miss another post!

Share this!

4 Comments to D365 Dialogs functionality using Power Automate: When a record is selected

  1. Thanks for the tutorial. It’s a shame that option sets are not supported, that’s a major limitation. Unfortunately, no feedback can be given to the user via dialog. That makes this feature almost useless for end users

    • Actually option sets and multi-select option sets are now supported. You can add them by adding a text field and clicking on the three dots to turn them into an option set or multi-select option set!

  2. Hi Dian,
    Great blog!

    Just one question, can we refresh the page or data once the flow execution is completed.
    I want to update same record and also want to refresh the data once user submit this form.

    Thanks

    • Thanks Shrikant! That would be a refresh of the browser, which I don’t believe you can do with flow.