Log Canvas Power App telemetry data in Azure Application Insights | Power Apps

Here’s how you can register your Canvas Power App in your Azure’s Application Insights and log telemetry data into Azure.

Some basic info about what all you can see in Application Insights is –

  1. Count of Users who used the app
  2. Events logged, Sessions logged
  3. Device info
  4. Region info

It’s quite simple to set it up! Let’s take a look –

Registering in Application Insights in Azure

First, make sure you do have an Azure Subscription. Let’s look at how you can register an Application Insight record.

  1. Look for Application Insights in Azure in the search bar

  2. Then, among other records, you can register a new one which will identify with your Canvas Power App

  3. Review all that you entered and move ahead

  4. It’ll be deployed pretty quickly within a few minutes unlike some heavy Azure resources

  5. Upon completion, you can navigate to the resource and see the details

    Zoomed In


Add Instrumentation Key to Canvas Power App

Next step is to add the Instrumentation Key to the Canvas Power App

  1. Look for the App itself in the Navigation tree

  2. Once you select that, you can then look at it’s Properties on the right hand side. In Instrumentation Key, paste the Instrumentation Key you copied when you created the App in the Azure.

  3. And to go with that, let’s say my Canvas Power App has some basic structure like below

Using Application Insights

As the users use the Canvas App, the following information is logged –

  1. Navigate to the Usage section in the Application Insights you registered and if you scroll down on the main pane, you can see w

  2. And then scroll down to reveal more Insight data


  3. Or, if you see Events, you can see info like this –

    I’m not completely sure why my users showed high when I tried with only 2 users. But perhaps, once I dive more deeper into using Application Insights and how each of the metrics are read, I’ll come back to update this post. 😊

And likewise, if you know how to read the Application Insights, you can customize this to give you what you need to see.

Here is some Microsoft Documentation on Application Insights to help you out –

  1. https://docs.microsoft.com/en-us/azure/azure-monitor/app/usage-segmentation

Hope this was useful. Here are more Azure/Canvas Power App related posts you might want to check –

  1. Call Azure Function from Dynamics 365 CRM using Webhooks
  2. Use Azure App Passwords for MFA enabled D365 authentication from Console App
  3. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  4. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  5. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  6. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  7. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  8. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  9. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  10. Implement character length validation in a Canvas Power App | Power Platform

Thank you!

Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]

If you’ve been using classic CRM since 2011 days until Solutions History came out (around 2018 timeline), we always wondered when was a certain field, view, form (component in general) was created.

It’s possible to see using Solution Layers

Example: When was a field created

Let’s say you want to find out when a field was created.

  1. Select the field, check for Solution Layer as shown below

  2. Now, go into the Active layer

  3. In Active layer, scroll down to the details

  4. You’ll be able to see the Created On field

  5. If there was a component/field that is too old and was created before this feature was introduced, it’ll show a default 1900 DateTime value

Looking elsewhere

I tried to look for this info in XrmToolBox’s Metadata Browser but couldn’t find it –

Please let me know if any better suggestions as well! 🙂

Here are some more Dynamics 365 CE / CRM related posts you might want to check –

  1. Dynamics 365 Solutions History – Keep track of your deployments
  2. Using ‘Clone a Patch’ & ‘Clone Solution’ in Dynamics 365 Solutions
  3. Add multiple Opportunity Products at once in Dynamics 365 Sales | Enhanced Experience [Preview]
  4. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  5. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  6. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  7. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  8. Dynamics 365 Solutions’ New Experience in Power Apps, Solution Checker and more
  9. Check Managed Solution failures in Solution History in Dynamics 365 CRM
  10. Store ‘Today’s Date’ in a field to use in workflow conditions in D365 CE

Hope this was useful

Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate

Now, there are several questions about how can we make HTTP requests from a Canvas Power App. Well, as of today, only HTTP with Azure AD exists in native Canvas Power App Connectors, so in order to call HTTP requests only to external resources, you’ll need to go via a Flow and get response back.

Scenario

Call a Flow from within a Canvas Power App and capture the response back in the Canvas Power App.

In my example to keep things easy, I’m using a sample HTTP request provided by https://openweathermap.org/ (OpenWeatherMap) [I know there are native Weather connectors, but I’m just using as an example]

Flow

Here’s how Flow looks –

  1. Let’s say I create an Automated Flow which is triggered from a Power App. Just select that, there’s nothing to add to it.


  2. Next Step, I’ll make an HTTP request to a Service (In my example, I want to retrieve Humidity. You would of course have your use case)
    I’ve used the same example in one of my posts where I talked about making HTTP requests using Flow. Check this post – Make HTTP request from Flow in Power Automate


  3. To breakdown my received HTTP response into distinct pieces of info, I’ll parse it.

  4. Final step would be to send back the parsed info to the Power App itself so that I can use the info internally in the Canvas Power App from which this Flow was called.

  5. Now, I’m choosing to send back the Humidity value. So, I’ll choose a type of Output to be sent my response into

  6. And since I already parsed the response in the step above, it’s easy to select what piece of info I want to send back to my Canvas Power App.
    I’ve created a variable called as humidityValue and in that I’m passing humidity from the parsed JSON step.

  7. That’s it. My Flow overall looks like this

Canvas Power App

In my Canvas Power App, I only have a button which will populate the data into a label –

  1. Let’s say, I have a button called as Get Humidity. And below it, is a Label having “Humidity is” already written

  2. Now, the next step is to add the Flow in the Canvas Power App. Navigate to Action in the menu bar in Canvas Power App Studio and look for Power Automate

  3. On clicking it, you’ll be able to select the Flow you want to add in the Canvas Power App

  4. Once you select that, it’ll appear on the OnSelect formula bar of the button. Ideally, this should be added to whatever event you want the Flow to Run from (In my case, click of Get Humidity button)
    It’ll populate with a default formula like below. But we need some modification for it to be populated to the Label.

  5. Now, you can write the below formula to add the value retrieved from the variable which you created dynamically called as ‘humidity‘ and upon adding dot to the Run(), you’ll be able to select the variable you passed to the Canvas App from Flow.

  6. So, the completed Formula looks like this.
    Here, I’m using Set() function to set a dynamically declared variable in called as humidity and populate it with the value of humidityValue which we’ll get when we run Flow and the Flow will make an HTTP call to get that value.
    In case you also need to understand how variables work, you can refer this post of mine – Variables in Canvas Power Apps | Global and Context

  7. Now, we need to set it to the Label. So, we’ll write a formula on the Label’s Text event. So that, the Label is displaying Humidity is <valueOfHumidity> variable

  8. And you’re set. Hope this explanation was easy. Now, let’s Run the App and click Get Humidity button

Working

When I click a button, I’ll get the value into the Label field which I created.

When I click the button, it’ll be greyed out for a moment while the Canvas Power App calls the Flow and the Flow runs the HTTP request and sends back response to Canvas Power App.

Finally, once the variable is set, the Label control will display the value as below which came via HTTP using Flow

You can also see the results going in the Flow Run as well

Hope this was useful. Here are some more Canvas Power App & Power Automate posts you might want to look at –

  1. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  2. Accept HTTP Requests in a Flow and send Response back | Power Automate
  3. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  6. Logged In User details in a Canvas Power App
  7. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  8. Implement character length validation in a Canvas Power App | Power Platform
  9. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  10. Pause a Flow using Delay and Delay Until | Power Automate
  11. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  12. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  13. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  14. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  15. Using Parse JSON to read individual List Records in Flow|Power Automate

Thank you!

Change Booking Status colors on Schedule Board for Field Service/PSA [Quick Tip]

Here’s a Quick Tip for everyone using Field Service and Project Service Automation. In case you are wondering how can you change the colors of the Booking Statuses on the Schedule Board for Field Service and PSA, here’s what you need to do.

Default Colors

This what your default Schedule Board looks like out-of-the-box.

Booking Statuses

Booking Status is an entity within which you can set this up.
You can navigate to Booking Statuses entity in your Field Service like below

There are these records you can modify. Also, for PSA, you have the same entity with different records for Booking Statuses
But, let’s look at Field Service’s example –

Now in each record, you can see in Common tab

And you can change by selecting this color picker control

And save the new selected color.

And let’s change for Completed as well, just another example – changed for Completed also to a greenish shade

Updated Colors

Now let’s look at the updated Schedule Board of how these colors look.

Hope this quick tip helps!

Here are some more PSA/Field Service posts you might want to look at –

  1. How to add Rating Values to Rating Models in D365 Field Service and PSA
  2. Why we see Cross Day in Work Hours on Bookable Resources/User?
  3. Modify Project tab’s view in Schedule Board in PSA v3 | Quick Tip
  4. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  5. Additional columns in PSA v3 Schedule view
  6. Update Price feature in D365 PSA v3
  7. A manager is required for non-project time entries, absence, and vacation error in D365 PSA v3
  8. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  9. Booking Resources more than their capacity in D365 PSA v3
  10. PSA v3 View Custom Controls used on Project form

Thanks!

Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate

Let’s say most of your users are using custom Canvas Power Apps to follow their business tasks and rely on Canvas Apps for their actions inside Dynamics 365.

There could be scenarios where you want to notify them conditionally of important items that need their attention.

Scenario

Let’s say you have a few users whom you want to tell them that an Opportunity was Won. It could be a team or a single User.

Here’s what my scenario is – A PowerApp Notification is sent to designated User(s) using Flow. When an Opportunity is Won

A Power App Notification is received

And when user clicks he Notification, Canvas Power will open and show that record.

But of course, your implementation/applications for this can be limitless!! This is just my example!

Flow

Here’s what the Flow looks like –

  1. I’m triggering the Flow on Update of the Opportunity. You can use Trigger Conditions to make sure your Flow is triggered only on the update of the Opportunity Win

  2. [Optional, according to my scenario] I want to send this to the Owner of the Opportutnity for now. Of course, it makes sense to send it to others. But let’s keep it simple for now. 🙂
    So, I’m capturing Email address here to be used further down



  3. [Optional, according to my scenario] Further, I’m only checking if the Status was Won. Status Reason = 3 meaning Opportunity was Won


  4. Next, once your condition is satisfied, you can search for this Connector and Action in your Steps in the Flow.


  5. For now, you only have this one Action which you’ll need.


  6. This is how it looks –
    Recipient Item – 1 holds the Email address of the User to whom the notification will be sent to. More can be added by using the + Add new item button.
    Message holds what should be displayed when the notification is received to the end user.
    Open App – Yes/No. Boolean to set if the Power App is supposed to be Opened upon selecting the Notification or not.
    Parameters – You can pass parameters to the Canvas App and use it inside Canvas App. Example: To open the record directly if the App is designed in that way.



  7. First thing you need to do is to create a specific connection for this so that you can use it to open the specific App in Power App.


  8. You can give your Connection a name and then the ID of the App must be entered. Once done, click create.

  9. In case you’re wondering where you’ll get the App ID. You can find the Canvas App ID in the Details section of your Canvas Power App, you’ll only need that to be copied


  10. And you can enter the below options –
    In my example, I’m sending an alert to the email I captured in #2 above.. In your case, you can set this dynamically and add more as well by clicking on “+ Add new item

    In Message, I’ll enter what the notification should read.
    Open App is set to Yes. Means if I click the notification, it’ll open the Canvas Power App whose ID I used above to create the Connection.

    Parameters, this is optional. If you want to open the specific record, you can pass the GUID like this and in the next section, we’ll see how we can open the record using that.

Canvas Power App

In the previous step, remember we sent the Guid as parameter to the Canvas Power App, here’s what you can do to read the record and use it to open the specific record.
Here’s how you can read Parameters passed to the Canvas Power App.
Param(“<ParameterName>”)

I’m using it to Lookup the Opportunity that I passed from the Notification to the Canvas Power App.

In my application, I’m using Lookup to fetch the record and set it to the Item property of the Edit Form control


Some references to use if you’re looking to Capture Parameters and Lookup/Filter data based on your GUID is that’s your implementation.

  1. Pass Parameters to Canvas Power App – https://sachinbansal.blog/2018/06/17/powerapps-canvas-app-how-to-pass-parameter-in-app-url-display-data-based-on-parameter-passed/
  2. Lookup/Filter Records – http://linnzawwin.blogspot.com/2019/12/power-apps-using-common-data-services.html

Working

Let’s say an Opportunity was Won in Dynamics 365.

And the user will receive a notification like this.


Clicking on which, they’ll be taken to the Canvas Power App record which I set in my Canvas Power App.

Hope this was helpful!

Here are some more Canvas Power App posts you might want to look at –

  1. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  2. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  3. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  4. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  5. Restore older version of a Canvas Power App | Power Platform
  6. Logged In User details in a Canvas Power App
  7. Implement character length validation in a Canvas Power App | Power Platform
  8. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  9. Number Formatting in a Flow | Power Automate
  10. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  11. Accept HTTP Requests in a Flow and send Response back | Power Automate
  12. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!

Add multiple Opportunity Products at once in Dynamics 365 Sales | Enhanced Experience [Preview]

Very easy tweak but this will save loads of your time. One of the most important asks by Salespeople is perhaps this – “Add multiple Products on Opportunity at once!

Here’s how you can do this –

Classic Experience

In current/classic experience, if you open Opportunity Lines and go on to add a Product as below –

It’ll either open in a New form.

This isn’t intuitive. You definitely need better experience.

Enhanced Experience

In System Settings, under Sales, you’ll need to enable the Adding Products to Yes. This will enable the enhanced experience.

  1. Now, when you click on Add Products in the Opportunity’s Product Line Items tab, you’ll see a Quick Create Form like form on which you can Add Multiple Products in one go.


    And then go to + Add products


  2. Now, a Quick Create form will appear on which you can select multiple products

  3. Now, when you click on any + sign in blue, you can directly enter what quantity you want to add.
  4. Also, if you go to the Selected section which indicated how many unique products you’ve added, you’ll be able to remove the added Products in case you don’t want them


    and then Delete the same if needed.

  5. Now, let’s say I have this finally and when I click on Add to Opportunity, they get added as Opportunity Lines


    And they appear as below

    Hope this helps!!

Here are some more D365 For Sales articles you might want to check out –

  1. Kanban view in Dynamics 365 Sales | 2020 Wave 1 Early Access Feature
  2. Territories enabled for OOB Hierarchical relationship in Sales Hub
  3. Create your own Insight Cards with Power Automate in Sales Insights
  4. Discount Settings for D365 Sales Line Items – Line Items or Per Unit?
  5. Talking Points in D365 AI For Sales
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Contextual Email communication in D365 CE Wave 2
  8. Customize Opportunity Close dialog box in D365 CE v9 Unified Interface – Wave 2 update
  9. Create & Send PDFs from Word Templates for Quotes in D365 CE Wave 2 Updates
  10. Save generated PDFs to SharePoint directly – 2020 Wave 1 | Early Access Feature

Thanks!

Recover deleted D365 PowerApp environment using PowerShell

To get the most important things out of the way, this can be done only within the first 7 Days.

Deleted Environment

At times, you want to delete an environment you don’t need. But you feel you do need it back. Deleting an environment from the Power Platform Admin Center will Soft Delete it and you can get it back within the first 7 days only.

Here’s some info by Microsoft on that: https://docs.microsoft.com/en-us/power-platform/admin/backup-restore-environments#how-long-are-my-manualon-demand-backups-and-system-backups-retained

Here’s what we can do within the first 7 days to get it back using PowerShell!

Get PowerShell Support for PowerApps

Before we are able to Run PowerShell directly to recover, you’ll need to get the support for PowerApps in your PowerShell first.

Refer this full Microsoft Documentation for full details: https://docs.microsoft.com/en-us/power-platform/admin/powerapps-powershell#power-apps-cmdlets-for-administrators-preview

  1. Open PowerShell and remember to Run it as as Administrator.



  2. Here’s how you can install the capabilities

    And then

    Here are the 2 commands which I used in the screenshots above in PowerShell. Below is the screenshot I took from Microsoft Docs so that you can visualize how the commands look
  • Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
  • Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber

    or if you don’t have Admin Access, below code can be used in PowerShell
  • Save-Module -Name Microsoft.PowerApps.Administration.PowerShell -Path
  • Import-Module -Name Microsoft.PowerApps.Administration.PowerShell
  • Save-Module -Name Microsoft.PowerApps.PowerShell -Path
  • Import-Module -Name Microsoft.PowerApps.PowerShell


4. Now, let’s say you are all set to execute your recovery process.

Recovery of Environment

Assuming you have completed the above steps, you can now proceed towards recovering the environment.

  1. Now, in PowerShell, run the below command “Get-AdminPowerAppSoftDeletedEnvironment

  2. You’ll be directed to a Login screen. Enter environment credentials there.


  3. You’ll get the Deleted environments’s details as below. In my case, only 1 Deleted environment was retrieved

    Note the first line i.e. EnvironmentName. Copy that GUID

  4. Next, run the below command after you copied the GUID –
    Recover-AdminPowerAppEnvironment -EnvironmentName 35545668-80c2-4d88-811d-b698bb1bcf59 -WaitUntilFinished $true

  5. Once completed, you won’t see any message but the cursor will be on the new line ready. And some details about the success of the operation.

  6. And in the Admin Center, the environment will be recovered.


    Hope this helps!!


    Here are some more Power Platform related posts you might want to check –
    1. Create new Sandbox and copy Production over to it in PowerPlatform Admin Center
    2. New ‘Capacity’ analytics on PowerPlatform Admin Center
    3. D365 Admin Center: Instance Picker Link

Thank you!


Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists

Let’s say you are using SharePoint Lists to populate your Data Table in a Canvas Power App. And you have a Text column which could be typically name of the Website and another column could be a URL.

Now, you want to be able to click the Name of the Website and the selection should take you to the Website itself.

Scenario

Now, below is the Blog List in SharePoint you are populating your Data Table in a Canvas App with.

Now, I’ll use the above list to populate the Data Table to only show the Title in the Data Table and make the names clickable so that the URL of these Website names should be navigated to when you click them

Data Table column

  1. Firstly, the Names of the Blogs will appear in Plain Text because in SharePoint, this field is of Type plain text.


  2. In order to convert them to hyperlink, select the column as shown below


    And then, on the right hand side in Table Column Properties, turn on the Is hyperlink flag to On

  3. Now, the names will be clickable

Now, these Titles should be clickable and navigate to the URL which is mentioned for each of these Website Names.

OnSelect property and Launch Function

  1. Every Data Table column has an OnSelect property which you can set.

  2. Now, you can use the Launch() function to launch a URL which in this case will launch/open the data from the URL column of the Data Table (which we have not displayed anywhere in the Data Table)


    Now, here’s what the above Formula is set as
    Launch() will accept Text values. The “BlogList Data Table” is the name of the Data Table we are using i.e. the SharePoint List.
    .Selected will consider the Row we will click/select.
    And URL is the name of the column where the URL resides.
    Hence, it’ll Launch the URL we specified again each website name.

Working

When you open the App, and click on the name of the Site


Hope this was useful!!

Here are some more Canvas Power Apps posts you might want to check out

  1. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  2. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  3. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  4. Restore older version of a Canvas Power App | Power Platform
  5. Implement character length validation in a Canvas Power App | Power Platform
  6. Logged In User details in a Canvas Power App
  7. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  8. Variables in Canvas Power Apps | Global and Context
  9. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  10. Adding a Canvas PowerApp to Teams

Thank you!