Create Application Users for Dynamics 365 environment | Power Platform Admin Center

Here’s how you now set up Application Users in Dynamics 365 CRM from the Power Platform Admin Center instead from the Classic UI and let’s see how the process is eased.

Classic UI

Previously, you used to see Application Users view in the Dynamics 365 CRM under Settings > Security > Users.



But it’s not longer available. Instead, you now go to the Power Platform Admin Center.

Register App in Power Platform Admin Center [PPAC]

Now, once you are in the Power Platform Admin Center, you can go to the Environment section –

  1. First, let’s say this is your App in your Azure’s Active Directory in the App Registrations. And now you want to create an Application User in Dynamics CRM for this App.

  2. Now, you can go to the PPAC (https://admin.powerplatform.microsoft.com/) and in Environments, look for your D365 CRM/Dataverse environment.

  3. In Settings, you’ll see Users, expand the same and you’ll see Application Users which is now it’s own separate option.

  4. Now, you’ll see the Registered Apps I have already and you can add from the “+ New App User” button above.

  5. Now, select the + Add an app button

  6. And you’ll see the complete list of all the Apps that are in your Azure’s Active Directory. Select the one your just created and click Add.

  7. And then finally click Create once you Add the App you want to create Application User for.

  8. And now, you’ll see the App added as an Application User for your environment.

  9. Now, you also need to provide Security Roles based on the requirement. Select the App User, and click on Edit security roles once available.

  10. In my case, I’m giving 3 Roles which I need to give and click Save.

  11. Now, I’ll also see how many Roles have been given to the App User.

Hope this was helpful! Here are some more Dynamics 365 posts which you might be interested in –

  1. Setup Postman to connect to Dynamics 365 CRM using OAuth 2.0 | Azure App Registration
  2. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  3. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  4. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  5. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  6. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  7. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  8. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  9. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  10. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  11. Call Azure Function from Dynamics 365 CRM using Webhooks
  12. Show Ribbon button only on record selection in Dynamics CRM
  13. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!

Enable Power Automate Pane in Canvas Apps Studio | Preview

Now, you can start creating Flows from within the Power Apps itself and add Power Automate as a Pane on the left hand navigation.

Let’s check out how –

Enable Power Automate Pane

In the App Studio, here’s how you can turn on the Power Automate pane –

  1. In the App Studio, you can see the Settings button, clicking on which will open up the Settings area.
    Go to Upcoming Features tab and look at the Preview section since this feature is still in Preview.

    You’ll find the Enable Power Automate pane option turned off by default.

  2. Before you turn it on, you’ll see the left hand menu doesn’t have a Power Automate icon/section added already.

  3. And when you Turn it On, you’ll see the Power Automate section added.

  4. Now, when you expand it, it appears like you can create a Flow from here.

  5. When you click on Create new Flow, you’ll get the option to start creating from a Template or create a new one like you usually do in Power Automate app itself.

  6. I clicked on Create from blank in the above step, you’ll then get the Flow editor right there and PowerApps as the trigger since this will be triggered from your Canvas Power Apps.

  7. Now, you can continue to build you Flow and once done, it’ll be available in the list to be used.

  8. And you can then use this Flow as per requirement.

Existing vs New Method

Let’s see the subtle difference between the existing and the new method -1

  1. Once you enable this, you’ll find 2 Power Automate buttons (Perhaps this will change in the near future)
    Once will open the new pane and the other existing one will open in the old way in context of the Screen being used.

  2. Additionally, the existing method will open the Power Automate portal itself in the new tab as opposed to opening the Flow in the Canvas Apps Studio itself.

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Showing Sandbox or Non Production Apps in Power App mobile app
  2. Create a Power Apps Per User Plan Trial | Dataverse environment
  3. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  4. Co-presence in Power Automate | Multiple users working on a Flow
  5. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Call a Flow from Canvas Power App and get back response | Power Platform\
  8. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  9. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  10. Asynchronous HTTP Response from a Flow | Power Automate
  11. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  12. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Retrieve day number from a Week, Month and Year & day name in Power Automate

At times, while working in Power Automate, you might only want to retrieve the number of Day / Month / Year / Time etc from the DateTime. Or even just the name of the day, given the date.

Here’s a set of functions in Power Automate you can use already!

Day number functions in a Flow

Let’s look at a few examples on how you can retrieve parts of a DateTime –

  1. Let’s use a String variable to store all this content in an on-demand Flow.

  2. And in the Expressions section, look for the day functions.

    dayOfMonth()
    dayOfWeek()
    dayOfYear()


    All three functions take a DateTime timestamp


  3. Example, for simplicity, I’m only considering utcNow() function to refer to the current DateTime instead of using a DateTime variable.
    So, I’ll first use dayOfMonth() function

  4. And this gives me the day # of the Month which is equal to the Date itself.

  5. dayOfWeek will give me 0 for Sunday, 6 for Saturday.



    Since the day of writing this post is a Sunday, it will give me 0.

  6. And dayOfYear() will give me the day number of the year.


    And today is Day 72 of the year.


    First day of the Year starts with 1. You can use the below function to check the first day of the year in dayOfYear() and it will return 1.

  7. And the result is as below –




  8. I also have a previous version of this post as well which you can refer here – FormatDateTime function in a Flow | Power Automate

Name of the Day

If you want to simply retrieve the Name of the day, you can get it using FormatDateTime function –

  1. So, in other context, I simply used FormatDateTime() function.

  2. And got the below answer –


    You can find complete reference of the DateTime formats used in Power Automate in Microsoft’s official post here – https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings?WT.mc_id=DX-MVP-5003911

Hope this was useful!
Here are some more Power Automate posts you might want to check –

  1. Enable SharePoint Online integration Dynamics 365 | Power Platform Admin Center
  2. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  3. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  4. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  5. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  6. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  7. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!

Retrieve fixed number of records in FetchXML in Dynamics 365 CRM | [Quick Tip]

FetchXML is one of the common approaches used for retrieving records from CRM either using Plugins or JavaScript

At times, you want to retrieve only a fixed number of records based on the requirement or even if you want to just debug the plugin and don’t want all the records to be retrieved in your tests. So, here’s what you do!
Also, if you are new to Dynamics 365 CRM plugins, you might want to check this Plugin Development series I posted – Plugins Development in Dynamics 365 CRM for Beginners | [Blog Series]

FetchXML

  1. The FetchXML below is usually the only you are going to end up using since you are retrieving all the Contacts.

    This will retrieve all the records for you.

  2. Now, let’s add a “top” attribute in the <fetch> tag to retrieve only x number of records which you mention.

And that was it, same is applicable even if you are using XRMToolBox to test your FetchXML query using FetchXML tester.

Hope this was helpful! Here are some more Dynamics 365 posts which you might be interested in –

  1. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  2. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  3. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  4. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  5. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!

Setup Postman to connect to Dynamics 365 CRM using OAuth 2.0 | Azure App Registration

If you want to test the WEB API in Dynamics 365 CRM using Postman, here’s what you need to do to setup Postman to connect to Dynamics 365’s Web API

There are 2 parts to this setup –

  1. Registering an App in Active Directory.
  2. Configuring Postman to utilize the App to connect to Dynamics 365.

So, let’s look at how we do this!

Register an App in Azure

The first step is to register an App in your Azure’s Active Directory so that you can use it to test using your Postman on your machine –

  1. Go to the Azure Portal (https://portal.azure.com/) and the look for or search for Azure Active Directory

  2. In AAD, look for App Registrations.

  3. Now, register a new App in the App Registration

  4. Enter the details of the App Registration so you can identify what the App is for. Since I’m using this for Postman testing, I’ll enter something like – “Postman WEB API
    Also, since in most cases your Azure environment could be different, it’s recommended to select Accounts in any organizational directory (Multitenant), but it’s up to you based on how you can to secure this!
    Since, I’m testing on my local machine using Postman, I’ll enter http://localhost

    And finally click on Register.

  5. Once this is registered, you’ll see the details like any other Azure resource and look for Client ID and copy the same and save it somewhere temporarily.

  6. Next is updating the Manifest to support this setup.
    Set the “allowPublicClient” flag to true and “oauth2AllowImplicitFlow” to true as well.

  7. Once the Manifest is updated, it should look like this –

  8. Final step is to give permissions for Dynamics 365 to this App we just created. Go to API Permissions tab from the left-hand menu and click on + Add a permission button.

  9. Look for the Dynamics CRM option and select it.

  10. Select it and then click on Add permissions.

  11. Once added, you’ll need to Grant Permissions. At this moment when it’s not granted, the Status can be seen as blank.

  12. Select Yes to Grant Permissions.

  13. Once granted, the Status will be updated as follows – the status of Granted for [OrgName] will appear

  14. And we are done setting up the App in Azure Portal to be utilized by Postman to test Dynamics 365 Web API locally.

Setting up Postman

Now that we have the App setup, open Postman and we’ll utilize the above created App to establish a connection with Dynamics 365 CRM using OAuth2.0 –

  1. In your Dynamics 365 CRM environment, capture the OAuth URL in your Customization > Developer Resources section

  2. Enter this in a new Tab in your Postman and if you directly try to test this, you’ll get 401 Unauthorized.

  3. Now, we’ll have to configure the Authorization tab to be able to authenticate into Dynamics 365 CRM using the App registration we created in Azure in steps above.

  4. Now, enter the details we have captured so far –
    Token Name – Enter a suitable Token name
    Grant Type – Select Implicit if not already set.
    Callback URL – The callback URI should be http://localhost based on what we set in Azure in above steps.
    Auth URL – Here’s how you can get the Auth URL for your Dynamics 365 environment -> OAuth 2.0 URL for Dynamics 365
    Client ID – This should be what you saved above from the Azure App Service. Refer to step #5 in the Setting up App in Azure section above in this post. This should be the Application ID.

    Once all this is entered, click on Get New Access Token

  5. Once you click on Get New Access Token, you’ll need to authenticate into the environment as you usually get while connecting from Browser.
    Enter credentials and authenticate.

  6. Once this connection and the permissions are correctly validated, you’ll get a message like this –

  7. And it’ll show you this dialog box where you need to simply click on the Use Token button.

  8. You’ll then see the token as below –

  9. And you’re set!! Now, you can simply test using Postman.

Testing using Postman

Now that you are authenticated, you can click on Send and see that you are now able to retrieve the Web API

Hope this was helpful! Here are some more Dynamics 365 posts which you might be interested in –

  1. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  2. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  3. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  4. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  5. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!

OAuth 2.0 URL for Dynamics 365

If you are new to using connecting to Dynamics 365 using OAuth 2.0, here’s an Auth URL you’ll need for your external applications / Postman testing of Web APIs in Dynamics 365 CRM.

URL for OAuth2.0 for Dynamics 365 CRM

The URL is: https://login.microsoftonline.com/common/oauth2/authorize?resource=[URL of the D365 Environment]

In the square brackets, you can put the URL of your Dynamics 365 CRM environment itself like shown below –

And then the URL should be: https://login.microsoftonline.com/common/oauth2/authorize?resource=https://cft158.crm.dynamics.com/

Hope this was helpful! Here are some more Dynamics 365 posts which you might be interested in –

  1. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  2. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  3. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  4. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  5. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!

Analytics of a Flow in Power Automate

Let’s understand how you can look at a Flow and check the Analytics it generates as the Flow is being used.

The maximum Analytics generated for a Flow is 30 days and not beyond that at this point. This might change in the future.

Analytics on Flow

Open a Flow in Power Automate and let’s see how we can access the Analytics of a Flow –

  1. When inside a Flow, you’ll see and Analytics button in the menu.

  2. Or even if you are in the list to view all the Flows, you’ll see them like this –


  3. In the Analytics Page, you’ll find a first tab you’ll find is a Actions tab which loads a PowerBI Report load and show something which is called as AggregationDateMakerDailyActions and BillableActionsMakerDailyActions which show the total Actions being executed per Flow run on a daily basis.

    I know this might be a little overwhelming, hence, here’s a reference Document to understand the same –
    Introducing action analytics in Power Automate – https://powerautomate.microsoft.com/en-us/blog/introduction-action-usage-analytics-in-power-automate/?WT.mc_id=DX-MVP-5003911

    And here’s a Microsoft Doc on understanding Request Limits and allocations – https://docs.microsoft.com/en-us/power-platform/admin/api-request-limits-allocations?WT.mc_id=DX-MVP-5003911

    Please note that the maximum range you can go back to get this data is 30 Days!



    Let’s look at the other 2 tabs –

Usage

Under the Usage tab, you’ll see how many Flow Runs were Successful vs Failures [Example taken from another Flow since I had to capture some failures too 😊]

Errors

In the Errors tab, you’ll see which all Flow Runs failed on what types or Errors. This is helpful in understanding the different issues the Flow needs to be addressed for –

  1. Below is how you’ll see the different types of Errors all the Flow Runs are divided amongst.

  2. And if you see the list of Failures, you’ll see that there is a hyperlink to each of the Flow Run itself.

  3. Clicking on these, they take you to the actual Flow Run itself.

Hope this was useful!
Here are some more Power Automate posts you might want to check –

  1. Enable SharePoint Online integration Dynamics 365 | Power Platform Admin Center
  2. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  3. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  4. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  5. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  6. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  7. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!