Power Fx Fomula Data type – your new companion in addition to Calculated fields in Dataverse [Insight]

Hello Folks,

I believe ever Power Platform professional working on Dataverse had one or other time got a chance to work on calculated fields. Actually it provides an easy way to perform any calculations for the supported data types since it has been introduced with CRM Version 2015 update 1.

Here is a very simple example of simple calculation to get your Fx data type up and running in few seconds….follow along….

Navigate to https://make.powerapps.com/

Open your solution, navigate to the columns in any table….for simplicity I am taking example of Accounts table…

Now create new column as below

Key values for the field, make a note that the data type (Fx) is selected

I already have two fields as below already on the form for calculating the Annual revenue per Employee from Annual Revenue of the company…

So now let’s write a simple Power Fx formula to calculate the Annual Revenue per Employee…the expression goes as below…

Annual Revenue is a currency field and Number of Employees field is single line of text. As soon as you save, system automatically identifies the data type as Decimal Number as shown above, click on save and publish the form…

Let’s see the actual use in the form…as soon as you enter the values for Annual Revenue and Number of Employees and save, the value for Calculated Revenue for the Employee field value will be calculated by the Power Fx expression.

Hope this will be useful in future for your implementations…

Points to keep in view:

  1. This formula column is in preview right now at the time of writing this blog post.
  2. And currently, formula columns can’t be used in roll-up fields or with plugins.
  3. You can use the following operators in a formula column:
    +, -, *, /, %, ^, in, exactin, &
  4. Microsoft Documentation says that the Currency data type isn’t currently supported but it works actually.
  5. The Text and Value functions only work with whole numbers, where no decimal separator is involved

Ref: Formula Column

Cheers,

PMDY

Setting up Postman Environment to test the Dataverse API’s – Quick Tip

Hi Folks,

Today in this blog post, I would like to share how we can quickly set up Postman Environment to test out the Dataverse API’s right away. It’s very easy and doesn’t need any Client Id, Client Secret registration in Azure AD for Authorization if you follow these steps as the provided Client id works for all Dataverse environments, so let me take you through.

You just need to have a Dataverse environment that you can connect to and Postman desktop App in your machine(Preferably windows)

  1. Lauch the Postman desktop application
  2. Create the environment by click

3. Enter a name for your environment, for example, Blog Environment as below

4. Get the Web API end point URL for your environment with few simple steps as below…by going to Developer resources in make.powerapps.com

Then copy the Web API endpoint URL as below…

Next step is to add following key value pairs in Postman for connecting to Dynamics..please make sure you use the same clientid(51f81489-12ee-4a9e-aaae-a2591f45987d), it is the same to connect to any Dataverse environment.

Variable Initial value

urlhttps://<your org name>.api.crm.dynamics.com
clientid51f81489-12ee-4a9e-aaae-a2591f45987d
version9.2
webapiurl{{url}}/api/data/v{{version}}/
callbackhttps://localhost
authurlhttps://login.microsoftonline.com/common/oauth2/authorize?resource={{url}}

Your updated configuration should look something as below in the Postman.

Click on save to save your newly created environment as highlighted below..

Now all you need is to generate access token in order to authenticate with your Dataverse environment to connect using OAuth 2.0

Follow the simple steps below..

Click on newly created environment, click on + symbol besides it as highlighted below

The following pane appears. Select the Authorization tab.

Set the Type to OAuth 2.0 and set Add authorization data to to Request Headers, if you scroll down a bit, you will be able to see Configure New Token option as below, else you wouldn’t.Auth request headers

In the Configure New Token pane, set the following values:

NameValueAction
Grant TypeimplicitChoose implicit from the drop-down
Callback URL{{callback}}Copy the value
Auth URL{{authurl}}Copy the value
Client ID{{clientid}}Copy the value

The settings should appear as below

Tip: If you were using the Postman to connect to multiple dataverse instances, make sure you clear your Cookies inorder delete the cookies in Postman.

Click on Get New Access Token button, within a moment, you should see a Azure Active Directory pop up to Authenticate your login from browser.

Click Get New Access Token.Once you click Get New Access Token, an Azure Active Directory sign-in dialog box appears. Enter your username and password, and then click Sign In. Once authentication completes, the following dialogue appears and just get the token with few more steps as below.

  1. Authentication completes
  2. After the authentication dialogue automatically closes in a few seconds, the Manage Access Tokens pane appears. Click Use Token.Access token page
  3. The newly generated token will automatically appear in the text box below the Available Tokens drop-down.Token autopopulate

Test your connection

The following shows how to test your connection using WhoAmI:

  1. Select GET as the HTTP method and add {{webapiurl}}WhoAmI in the editing space.Calling WhoAmI endpoint
  2. Click Send to send this request.
  3. If your request is successful, you will see the data returning from the WhoAmI endpoint, like below:Response from WhoAmI

Hope you have found this post useful…when you were working with Dataverse API’s.

Cheers,

PMDY

Automation Kit for Power Platform – Quick Review

Hi Folks,

Have you ever thought of a tool where you can review all your scheduled flows at once in one dashboard, then I am glad to introduce you the latest capability from Microsoft which is none other than Automation Kit.

If we get into detail, the Automation Kit is set of tools that accelerates the use and support of Power Automate for desktop for automation projects. HEAT is guidance that’s designed to help you deploy the automation platform and manage the entire lifecycle of an automation project.

The key features of this Automation Tool Kit:

  1. The ability to view the schedule of Recurring cloud flows
  2. View schedule by Day, Week, Month and Schedule view
  3. View the status of Scheduled flows (Success, Failure or Scheduled)
  4. View the duration of a Cloud Flow run
  5. View the details any any errors

The key element of the solution is the Power Platform main environment.

There are usually several satellite production environments that run your automation projects. Depending on your environment strategy, these could also be development or test environments.

Between these environments there is a near-real-time synchronization process that includes cloud or desktop flow telemetry, machine and machine group usage, and audit logs. The Power BI dashboard for the Automation Kit displays this information.

Automation Kit components

The Automation Kit supports an automation CoE with the following components:

  1. Automation Project: This project is a canvas app that supports requesting automation projects and submitting them for approval.
  2. Automation Center: This is a model-driven app that organizations can use to create and maintain automation assets, such as master data records, map resources and environments, and assign roles to employees.
  3. Automation Solution Manager: This is a canvas app in satellite environments that enables the metering of solutions and their artifacts.
  4. Cloud flows: These cloud flows use Dataverse tables to sync data from satellite environments, in near real time, to the main environment.
  5. A Power BI dashboard that provides insights and monitors your automation assets.

These two solutions contain the components in the kit.

  • The main solution, which you deploy to the main environment.
  • The satellite solution, which you deploy in each satellite environment.

Limitations:

  1. Only Power Automate Desktop and Power Automate solutions contained within a solution are displayed
  2. At least one Power Automate Desktop has been registered and executed

Reference:

Automation Kit for Power Automate

Automation adoption best practices overview

Learn More

I am glad to help you know about Power Platform Latest Capability…

Cheers,

PMDY

Power Automate performance improvement considerations

Hi Folks,

Thanks for visiting my blog…in this blog post, have you ever faced the situation where your flow keeps running with no output. Today I will list down the possible scenarios where you were struck with slow performance of the Flow.

Consider the below actions to make your flow execute smoothly.

Remediation steps/Actions to take to make your flow run efficiently:

  1. Understand the throttling limits for your connectors and data sources
  2. Check for Request limits based on user licenses
  3. Cross verify the throughput limits
  4. See the minimum number of actions that the Power Automate service will allow for each plan on the Request limits and allocation page.
  5. Do verify if you were using any on premise connectors
  6. You are hitting the throttling limit in Power Automate
  7. Redesigning your flow to use fewer actions and less data.
  8. Reduce the number of loop iterations for the iteration in ‘Do Until’ and ‘For each item’
  9. Filter your data to retrieve only what is necessary Filtering with Odata
  10. Consider reducing the frequency of scheduled cloud flow
  11. Reduce the file size being accessed if possible if your flow uses them
  12. Consider using Variables for frequently accessed information in your flow
  13. Use Compose and Variable actions to view the data at any time.
  14. Purchasing a Per User or Per Flow license from the pricing page
  15. Per Flow plan may provide best performance quotas available
  16. Enable concurrency control for your ‘Apply to each’ action
  17. Consider creating custom retry policy
  18. Use Select Actions
  19. Check your System jobs in Data verse if asynchronous service performance is normal
  20. Reduce the flow complexity
  21. Consider using Process Advisor for Power Automate.
  22. Verify if you were hitting 2 minute timelimit in dataverse if you were calling Bound or Unbound action in Flow.

Hope this helps someone who’s looking to optimize their flow.

Cheers,

PMDY

Top picks for Power Automate

What is Solution Checker and App Checker in Power Apps – Quick recap

Hi Folks,

While its been quite sometime since Microsoft shipped the Solution checker and App checker, these tools can help a developer to validate all the solutions that was being built before moving to higher environments. It is always advisable to run solution checker once your solution is developed so this can help you achieve better performance following the Power Platform best practices. Previously we used to send for Code review to senior folks but now with this tool, even the junior developer working at the ground level can easily understand and can make the necessary tweaks in the solution.

Solution Checker serves as a static analysis tool for the developers to check any platform related issues.

The solution checker analyzes these solution components:

  • Dataverse custom workflow activities
  • Dataverse web resources (HTML and JavaScript)
  • Dataverse configurations, such as SDK message steps

Note: Solution checker won’t analyze plugins in solutions. Plugin validations are modernized and will eventually the focus is on the native plugin authoring time, which will help you detect and fix issues earlier. So if you were looking for improvements in Plugin code, this will not help you.

Once solution checker starts running, it will be shown as below with a loading symbol on solution checker

It would take a few minutes to complete the process and will be based on the size of the solution. Once this process is complete, you should be able to download the results or view the results like below

If we open the results file, it shows the potential issues or improvements along with their severity which helps us to prioritize the issues which we need to work upon.

The report can also be downloadable excel file with analysis shipped in Zip format.

Now that we have seen what is solution checker, let’s see what App checker is and its pro’s and con’s.

App Checker:

  1. The App checker is now available to help provide a clear list of formula issues in your app, and to provide items to fix to make your app accessible
  2. This helps to make debugging, performance and best practice decisions an easier and more guided experience.  
  3. This is an ideal way to check the formulas you wrote for your Canvas Apps.
  4. There isn’t any possibility to download the app checker results but you can analyze the results on the fly in canvas apps.

To conclude you can think of Solution checker is a tool to check Model Driven Apps and App checker is a tool for Canvas Apps. Hope you will use this great features to improve your solutions and design according to best practices.

Reference:

Solution checker from MS Learn

Apps checker from MS Learn

Cheers,

PMDY

Top Picks for Power Apps

Top Picks for Power Automate

Top Picks for Microsoft Azure

Power Automate Pagination – Simple approach to retrieve 5000+ records from Dataverse

Hi Folks,

When coming to Power Automate, I see lots of articles regarding Pagination for retrieving more than 5000 records from Dataverse with varying complexity. It could be difficult to understand them at once if you were especially don’t much exposure on Power Automate working with functions and variables.

This post will give you a very easy way to retrieve more than 5k + records from Dataverse using PageNumber variable.

The Flow looks like below..

You just need two variables..

  1. Record count
  2. Page number

Lets create it…

For simplicity, create a manual trigger and initialize the two variables which we need.

Now create a do until loop to run until Page Number is 0.

Now define a Scope action as above to define your fetch criteria to retrieve the records from dataverse with Fetch updated as below

Add the Page Number variable created

Add a condition as above to check if List Rows Length is still greater than zero.

If yes, increment the length of Page Number, else set Page Number as 0.

In each iteration, increment the length variable. Here Residents entity is nothing but contacts.

Just save the flow, run it..you will find the number of records in the table(contact/resident) as below

That’s it, so simple right….

Some other related articles or references below:

Retrieve 5k + records using Pagination using Paging cookie

Retrieve 100k+ records using Skip Token

Hope this helps….someone looking for an easy approach for using pagination with dataverse.

Cheers,

PMDY

Azure API Management(APIM) for Power Platform

Hi Folks,

In today’s world, all the modern software applications use API for the front end to communicate with the backend systems, so lets see as it is very important for every developer working on Azure and API’s. Basically this is a PAAS Service from Azure. Follow along if you would like to know more details on this.

In short APIIM is a hybrid and multi cloud platform used to manage complete API life cycle. Azure API Management is made up of an API gateway, a management plane, and a developer portal.

  • Caching response to improve performance
  • Limit the number of API Calls
  • Security API and providing access
  • Interface to test API calls
  • API Analytics
  • Package related API Services
  • Transforms your API’s without
  • API Gateway is the first point of contact for any requests for your API which will route your requests to the appropriate backends. Imposes additional security restrictions with the help of JWT tokens and other certificates. Responses can be cached so that the API response could be faster.
  • Emits logs, metrics, and traces for monitoring, reporting, and troubleshooting
  • API Management are highly configurable, with control over URL mapping, query and path parameters, request and response content, and operation response caching.
  • Groups helps to provide conditional viewing capabilities.
  • Policy can help to change the behavior of an API without any code changes, this is well suited for your production API’s.

Also its easy to integrate API Management with all the other Azure Service available in the market.

Now lets go into the hands on by creating an APIIM simply from Azure.

Go to Home – Microsoft Azure and search for APIIM and select API Management services and click on Create.

Input all the details, it was pretty self explanatory, coming to the pricing tier you could select based on your project needs and use case. Click on Review and Create and then Create.

It will take few minutes for the deployment to complete and you can use it.

The below Power point slide presentation is complete resource which can help you with all your queries related to Azure API Management.

Grand Tour of Azure API Management

I hope this gives you a bit of introduction to Azure API Management, now lets see how you can use this in your Power Platform Solutions.

For this, once your API ready, all you have do is to export your API’s from Azure API Management to your Power Platform Environment. With this the citizen developers can unleash the capabilities of Azure where the API’s are developed by professional developers. With this capability, citizen developers can use the Power Platform to create and distribute apps that are based on internal and external APIs managed by API Management.

Steps to follow would be as below:

All you need to do is to create a custom connector for your API which can be used in Power Platform like Power Apps, Power Automate etc.

  1. Navigate to your API Management service in the Azure portal.
  2. In the menu, under APIs, select Power Platform.
  3. Select Create a connector.
  4. In the Create a connector window, do the following:
    1. Select an API to publish to the Power Platform.
    2. Select a Power Platform environment to publish the API to.
    3. Enter a display name, which will be used as the name of the custom connector.
    4. Optionally, if the API doesn’t already require a subscription, select Create subscription key connection parameter.
    5. Optionally, if the API is protected by an OAuth 2.0 server, provide details including Client IDClient secretAuthorization URLToken URL, and Refresh URL.
  5. Select Create.

Once the connector is created, navigate to your Power Apps or Power Automate environment. You will see the API listed under Data > Custom Connectors.

Custom connector in Power Platform

I hope this will give you a complete picture about API Management in Azure…if you have any further queries, don’t hesitate to comment here…

Cheers,

PMDY

Azure function – Dynamics CE integration guide

Hi Folks,

In this blog post, we will talk about the integration of Dynamics CE first party apps(Model driven) with Azure.

You can integrate with Function Apps from Dynamics using two ways…

  1. Authenticate your Dynamics CE app within your Function app code
  2. Register a web hook to trigger a call to Azure functions using a trigger

We’ll see both the scenarios…

  1. Authenticate your Dynamics CE app within your Function app code

Open your favorite IDE and create azure function..in this case I’ll be using Visual studio.

Create a new Azure Function Project(Make sure you install the Azure functions project template using extensions).

Click on Next option at the bottom, in the next step specify your Function App name as below.

Don’t change other values and click on Create at the bottom of the page.

So in the next step, please make a note of the important things which were highlighted below..

Make sure you select the Target framework as .Net Framework.

You can select any trigger, but for simplicity I am selecting HTTP Trigger here.

In case you need to debug your Azure function and run it locally, then you need to be sure that you install Azurite Storage Emulator in your machine using this link, otherwise you can select None for the storage account option, if in that case make sure that your Azure function don’t need any storage.

Don’t change other values and click on Create at the bottom of the page.

This will take couple of mins to create the necessary scaffolding required for the Azure function.

Now you need to authenticate to your Dynamics Instance, so firstly right click on your project and select Manage Nuget Packages. Then you need to browse for Microsoft.Crm.Sdk.CoreAssemblies and install.

Then you will be able to authenticate your Azure function with Dynamics CE…once you were authenticated you can create a hard coded entity record in Dynamics whenever your function app runs.

The entire code…is hosted in GitHub for reference.

In this way you can an integration between Azure function and Dynamics 365

We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/

To test the application, click on the Start button on top of Navbar as mentioned below in the screenshot [Button will have Project Name]. It will take a few minutes to Load the Azure Emulator

Run the Function App on the Local machine for testing.

Following is the screen you will be able to see and copy the URL highlighted in the red below and paste that URL in Postman.

Azure Function Tool

Open the Postman and click on the create a new tab

Postman Dashboard

Select request as POST and paste the URL:

After pasting the URL, click on Send

You will get the following response on the Azure Function Tool and Postman

The result after Sending Post Request to Azure Function

If there any error or issue with the Azure Function code, the request will be failed and will be displayed on both Azure Function Tool and Postman [Status will be “4**” or “5**” ]

Now, we will take look at Dynamics 365 CRM environment and check whether the account is created or not.

Result

Created customer from Azure Function.

2. Register a web hook to trigger a call to Azure functions using a trigger

Will update the post to add this logic next time.

Cheers,

PMDY

Overcome all your limits with Azure #PowerfulAloneBetterTogether Series

Hi Folks,

Hope every one should be very much interested in learning the base line for Power Platform which is Azure.

So this blog serves as the introduction in this #PowerfulAloneBetterTogether series.

Basically while designing your solution for your CE Apps, in order to improve the performance you need to make sure that you perform a minimal set of operations in CE and if in cases where you exceed the timeout limit in Dynamics CE and this is where the remote execution context should be passed to Azure Integration and move all your heavy operations outside your Dynamics CE preferably a line of business application.

So this is where we can think of the following possibilities for our integration…please click on respective link to navigate respectively…

  1. Azure functions/Function Apps
  2. Azure logic Apps
  3. Azure Service Bus
  4. Azure APIM
  5. Azure Event Hub
  6. Azure Cognitive Services
  7. Azure Cosmos DB
  8. Azure Synapse Analytics

I would be detailing about each of this integration with a separate blog post…how each one provides a bunch of alternatives to overcome our current limitations.

Hope this blog series would be of great help and will serve as a reference and your go to guide for your Power Platform and Azure Integrations.

Till then, happy CRM’ing…and stay safe!!!

Cheers,
PMDY

ALM is new buzz word for Power Platform Projects…a quick workshop guide….#Microsoft

Hi Folks,

Now a days ALM Dev ops is latest trend which every consultant should be aware of. There were tons of videos on Dev ops and creating a build or release pipelines but nevertheless they were sufficient as they were for too long period’s of time which spans roughly around 1-1.5 hrs.

So I was searching for some good blog or articles for the same which can save my time, this PDF guide from Microsoft is sound enough to get all you need with your ALM implementation for Power Platform.

Reference: GITHub Page

You can also practice with the amazing Dev Ops Labs available from Microsoft below…

Azure DevOps Labs

If you were more comfortable watching the videos…refer the below videos…follow along…

ALM for Power Platform from D365 Champs

ALM from Dharani

There you go….happy CRM’ing….

Cheers,

PMDY