Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate

I faced this issue lately and not sure if it’s a bug or something I might be missing. But, I couldn’t find anything in Dynamic Content in a Flow and I was not able to pick fields to use further in a Flow.

Not sure how many of you faced this since most fields you need are available in a Flow’s Dynamic Content part.

Scenario – Adaptive Cards for Teams issue

I had this one scenario in particular where the Adaptive Card I created for Microsoft Teams’ User sends back Response but the Dynamic Content doesn’t appear in the steps after the Card Step.

  1. See below that I’ve declared a Variable just to show that the Dynamic Content that should appear after the Adaptive Card.

  2. And if I press the Dynamic Content as shown above in Step #1, and minimize all the content, I don’t see the Teams’ Dynamic Content variables at all

  3. And the Adaptive Card didn’t return the below Outputs



    That’s when we should use outputs() function to read this data.

outputs() function

Here’s how you can use the Parse JSON action and outputs() method to read the Outputs of the step you want and then Parse JSON so that these can be picked as variables/dynamic values in steps following this –

  1. Take Parse JSON action from Data Operations in a Flow

  2. In that in Inputs, you can use Function on the Content field.

  3. And write outputs function as shown below –

    And the complete the function as below

    Explanation:
    MyCard is the name of the step of my AdaptiveCard I used. If the name of you step has spaces like “My User Adaptive Card”, then the function will look like outputs(‘My_User_Adaptive_Card’)[‘body’]

    body is written because if you see in the Outputs originally in the Scenario section above, all results are sent in body field of Outputs.

  4. Now, since you don’t know the Schema, just put a “{}” so that you can Save the step. (This is required)

  5. Run the Flow once and collect the Outputs from this ‘Parse JSON 2’ step as shown above.
    Copy the Outputs

  6. Now, open the same Parse JSON 2 step which you created. And click on Generate from sample

  7. And paste the schema in the box.

  8. Once done, schema will be generated like this.

  9. Now, this Parsed Outputs can be further used which will have the data from the Step which didn’t yield Dynamic Content
    Example, I’ll create a variable to show Dynamic Content that can pop-up

  10. It’ll show all the fields from the Card in the Parse JSON 2 outputs


    And that solves the problem!!

    Original Microsoft Documentation on the same is: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#outputs?WT.mc_id=DX-MVP-5003911

Hope this was helpful.

Here are some more Power Automate / Adaptive Card content you might want to look at –

  1. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  2. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  3. Save Adaptive Cards work using VS Code Extension – Adaptive Cards Studio | Quick Tip
  4. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  5. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  6. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  7. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  8. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  9. Terminate a Flow with Failed/Cancelled status | Power Automate
  10. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!!

Save Adaptive Cards work using VS Code Extension – Adaptive Cards Studio | Quick Tip

If you’ve started working on Adaptive Cards recently and always struggle with losing Adaptive Card payload from https://adaptivecards.io/designer/, you should use the Adaptive Cards Studio Extension.

So there’s a Visual Studio Code Extension for the same which will help you preserve and preview the Adaptive Card you are working on.

Problem Statement

While working with Adaptive Cards, we often struggle to make sure the browser tab doesn’t gets closed accidently and you lose your progress on the Adaptive Cards you are working on.


And, if you are struggling to maintain the Card Payload in a temporary file, there’s a smarter way available to do so using VS Code’s Extension – “Adaptive Cards Studio”

VS Code Extension – Adaptive Card Studio

Here’s how you can use the Adaptive Card Studio and how it can be useful.

  1. Open Extensions in Visual Studio Code and search for Adaptive Cards Studio

  2. Once installed, it’ll appear on the left hand side as below –

  3. On the right hand side in VS Code, it’ll search for the Workspace for the Adaptive Cards to detect. Make sure the folder in which your Adaptive Cards is saved is added to the Workspace.
    Else, the Extension won’t detect an Adaptive Card.


    In case you have saved the JSON file elsewhere which is not added to your Workspace, you can use this option to add the Folder to your current Workspace. (Depends on your Project structure)

  4. Once the correct Folder is added to Workspace in VS Code, the Adaptive Card you saved will appear


  5. If you expand the card, you’ll find Template and Data which you can get and paste from the Adaptive Cards online Designer and paste the same in here.

  6. Now, if you look at the main Window, you’ll be able to see the Template and Data JSON on the left and the Card on the right

Here’s the link to the GitHub for complete Info on the Adaptive Cards Studio: https://marketplace.visualstudio.com/items?itemName=madewithcardsio.adaptivecardsstudiobeta

And then further, copy the Payload onto your application where this will eventually be deployed.

Hope this was useful!

Here are some more posts that relate to Adaptive Cards usage / Power Platform –

  1. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  2. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  3. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  4. Accept HTTP Requests in a Flow and send Response back | Power Automate
  5. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  6. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Thank you!!

Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform

Let’s take a look at how you can design Adaptive Cards for Outlook and get response from Outlook users to process using Power Automate.

Scenario

Let’s say I wanted to send an Adaptive Card to an Outlook user on their Email and ask some comment, example – A descriptive feedback and read their response back and send them a confirmation Adaptive Card.

In this post, I’ll simply read the Response in the Flow and send a Confirmation-like Adaptive Card so that you can then further decide to take required action for it based on your use case.

Adaptive Cards Designer – Initial Card Layout

You can logon to https://adaptivecards.io/designer/ i.e. the Adaptive Card designer and start building your card. Below are the high-level steps:

  1. Once you are in the Adaptive Cards Designer, make sure you select the host app as “Outlook Actionable Messages

    You’ll see a sample already created for you which you can start working off of –

  2. Since I want to start from the beginning, I’ll select New Card option as shown below

  3. Now, I’ll start to design my card with the use of some TextBlock, an Input.Text to capture a response. In your case, you can choose the type of input(s) you want. (I’m trying to keep it simple for now 😊)
    These controls works like a drag-and-drop behavior, just drop whatever you need.


    So, I did the following, I added a TextBlock to add the title I want to show on the card and a Multi-line Input.Text to capture a response of the user I’ll send the card to in their Email.

  4. For the Input.Text, I’ve added an id ‘answer‘. We’ll need this when we capture responses back.
    Also, to make the Input.Text control as multi-line, Multi-Line option should be selected as I did below

  5. At this point, our Adaptive Card’s layout is ready. Before we proceed we must first, create a Flow that will capture an HTTP Response and then we’ll come back here.

Flow to Capture Response

Adaptive Cards for Outlook Actionable Messages work off of the HTTP mechanism and that’s why you need a URL where you can capture the responses and send back a confirmation response back.

Let’s call this Flow as “Accept Feedback Response

  1. To do so, first create a Flow that Accepts an HTTP Request. You can refer my other post in order to understand how you can capture HTTP Responses – Accept HTTP Requests in a Flow and send Response back | Power Automate
    Once once you save a Flow that has a trigger of HTTP Response, you’ll get a URL generated, copy it.

  2. Next, I’ll enter the schema by clicking on Use sample payload to generate schema button on the first step above and enter the following schema since I know that’s what is to be expected from the User when they fill in the Text and submit back.

  3. Once you click OK, your schema will look like this.

  4. Collect the result of the above trigger in the Compose so that you can save the Flow with at least 1 Action. (We’ll come back to it later)

  5. Next up, we will also need to setup a response Adaptive Card. This is something that the users will see when they Submit their responses.

  6. It is mandatory to send the response back to the caller i.e. the Outlook in this case. Hence, we’ll send a Response back using Response action in HTTP and send the status code as 200 and header CARD-UPDATE-IN-BODY as true.
    The Body will have the Adaptive Card which we created in step #5 above i.e. the Adaptive Card we have to send as confirmation.

    Here are the details of Refreshing Cards when you send back a response to the client (Outlook user in this case): https://docs.microsoft.com/en-us/outlook/actionable-messages/adaptive-card#refresh-cards?WT.mc_id=DX-MVP-5003911

Complete your Adaptive Card – Add Action

Once your Flow to capture the response is ready, let’s complete the Adaptive Card to add an Action to the same.

  1. Select the card body, you’ll see a button to Add an action

    You’ll need to select Action.Http

  2. Once you select the Action.Http type of Action, look at the Element Properties, you’ll need to enter the URL we got from the Flow we created to capture responses above.

    Here why we chose Action.Http – https://docs.microsoft.com/en-us/outlook/actionable-messages/adaptive-card#outlook-specific-adaptive-card-properties-and-features?WT.mc_id=DX-MVP-5003911
  3. Next, set the title of the Action (it appears as a button). I’ll name it Submit.
    Also, select what kind of Method is to be used for the HTTP Request.

  4. Now, since you’ve selected POST method, you will need to pass the Body. This will be the response which the user will send and which the Flow above will read it as a Response to process the information further.
    Once you select POST, a Body element property will be added where you need to enter the schema and what ID of the element that information belongs to

  5. Remember, the ID for the Input.Text was set as “answer”, we’ll put that here and then it’s Value property. These values should be enclosed in double curly brackets {{ }}.


  6. And also, you’ll need to pass along the Header for Authorization. Read this post by Microsoft – https://docs.microsoft.com/en-us/outlook/actionable-messages/security-requirements#action-authorization-header?WT.mc_id=DX-MVP-5003911
    Add Header as shown below

    Now, as mentioned in the above post, we need to pass the property as Authorization header and leave it blank and Content-Type as application/json

  7. Once all this is done, it’ll look like below in the card payload for the Action.Http part.

  8. Now copy the entire Payload from the Editor and we’ll create a new Flow that will be used to send the Adaptive Card to the user.

Flow to Send the Adaptive Card in Email

I’m creating a Flow here which will be used to send the Adaptive Card. To keep it simple, I’m just triggering it using a button on-demand. Your use-case will vary.

Let’s call this Flow as “Send Feedback Request

  1. Wherever you need to create the Adaptive Card, you’ll need to paste the entire Payload copied from the step above in a Compose step

  2. I’ll add a step to send an Email directly using Send Email and make sure you enable the </> part for the body.


    Make sure the Outputs of the Compose we pasted above in Step #2 are enclosed in
    <script type="application/adaptivecard+json">
    </script>

Working

Let’s look at how this will turn out!!

  1. Let me just Run the Flow as is so that the Adaptive Card is generated and sent to the user I intend to in the Email.
  2. They’ll receive an email like this

  3. And the user will submit the answer in the text box and submit.

  4. Once they submit, the Accept Feedback Response Flow we created will be triggered

  5. And the response is available to be read and processed further in the Compose step we created to collect it with the defined schema.


  6. The Adaptive Card we had created to send back as confirmation (which looks as below) will be sent

  7. Once the user submits, they’ll get the below Adaptive Card as a confirmation that their feedback has been taken.

And that’s how you can make your Adaptive Cards to function with Outlook!! Hope this was helpful.

Here are some superb posts on Adaptive Cards –

  1. Microsoft Message Cards – The Ultimate Guide by Thomas Poszytek – https://poszytek.eu/en/microsoft-en/microsoft-message-cards-the-ultimate-guide/
  2. Multi line Approvals with Adaptive Cards, Outlook and Power Automate by Yash Agarwal – https://www.bythedevs.com/post/multi-line-approvals-with-adaptive-cards-outlook-and-power-automate
  3. Custom Actionable Messages with Microsoft Flow series by Rik-de Koning (3 posts) – https://www.about365.nl/category/blog-series/custom-actionable-messages-with-microsoft-flow/

Here are some more Power Automate / Adaptive Cards posts you might want to look at –

  1. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  2. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  3. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  4. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  5. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  6. Terminate a Flow with Failed/Cancelled status | Power Automate
  7. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  8. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  9. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  10. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  11. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  12. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!! 😊

Make On-Demand Flow to show up in Dynamics 365 | Power Automate

Here’s a Flow trigger that you can make to appear on-demand in Dynamics 365 views. What makes a Flow appear on a certain entity?

Like this –

Common Data Service connector (Not Current Environment version)

If you’re familiar by now with Common Data Service Connectors, there are 2 of them. 1. Common Data Service, 2. Common Data Service (Current Environment).

  1. Here, you’ll have to use the 1st one i.e. Common Data Service connector. If you type Common Data Service in triggers, both will appear but you have to hover on these and make sure you don’t select the one with Current Environment written on it.

  2. Once you select this, you can select this trigger in order to make it on demand in Dynamics 365.

  3. Now, it appears like any other Flow trigger. Optionally, you can add some inputs in case you want to.
    In my example, I’m taking in a field value called as “Common Comments” and will just update the Description field of the selected Accounts for simplicity of this example.

    Because I want it on Accounts entity views, I’ll select entity Account.


  4. Now, my Flow looks like this. That’s it.


  5. To keep things simple, I’ll just update the record with whatever I put in the Common Comments Input variable in my Flow trigger.

    Now let’s see it work.

On-Demand Flow

Now, in Dynamics 365, I’ll navigate to Accounts entity and select a few records.

  1. Once I select a few records and check the Flows dropdown from the ribbon menu –



  2. If I run this flow, I’ll get option to put my Input parameters as I have declared above.

  3. Since I had selected 2 records, there’ll be two separate instances (Flow Runs) triggered for this Flow

  4. And I can see the values updated in the records. (Checking using Advanced Find)

    That’s it!!

Hope this was useful.

Here are some more Power Automate / Flow posts you might want to look at-

  1. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  2. Secure Input/Output in Power Automate Run History
  3. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  4. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  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. Accept HTTP Requests in a Flow and send Response back | Power Automate
  8. Terminate a Flow with Failed/Cancelled status | Power Automate
  9. Pause a Flow using Delay and Delay Until | Power Automate
  10. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate

Thank you!!

Run As context in CDS (Current Environment) Flow Trigger | Power Automate

In a CDS (Current Environment), you have to option to Run the Flow under a context of a certain user. And there are a few options from which you can select from – Process Owner, Record Owner & Triggering User

Here’s my Flow in which the trigger is the CDS (Current Environment) connector. Show advanced options and you’ll see that there’s a field call as Run As


Which has the following 3 Options as I mentioned above –

Let’s look at each one of these.

Scenario

To demonstrate Run As, my Flow is triggering on the Update of the Account record, an attribute in the CDS (Current Environment) connector called as RunAsSystemUserId provides the GUID of the System User used in the connector’s Run As field.

You can use triggerOutputs() function to get this GUID from the Trigger Outputs and use it to fetch the System User record. To see how triggerOutputs/triggerBody() works, check this post – Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Process Owner

As suggested, Flow Owner meaning the one who Owns the Flow

  1. If I select as Process Owner, no matter who triggers the Flow or who is the Owner of the record, the Run As user will be the one who Owns the Flow.


    The record could belong to one owner and the other owner might modify it as shown below –



    But the Flow will Run As the Owner of the Flow as suggested.




    Multiple Owners?
    In my test, I believe the one who created the Flow becomes the first Owner and hence, is what it appears in Run As

Record Owner

  1. Easily, the record Owner in Dynamics 365 is the Owner of the record, so no matter who triggered the Flow or who the Flow owner is, the Record Owner will be the Run As user.

  2. In this example, Priyesh Wagh is modifying the record Owner by Kuldeep Gupta, the Flow Run As will show as Kuldeep Gupta

Triggering User [Also Default]

  1. If the Run As is set to Triggering User, whoever caused the Flow to Run is the Run As context user.


    Let’s say Kuldeep Gupta is a user is modifying a record Owned by SYSTEM, the Run As user is Kuldeep Gupta.




  2. Now, if there’s no Run As selected or even if there are multiple Owners to the same Flow, the one who causes the Flow to run, is the context user of the Flow.


    Let’s say Priyesh Wagh modified this record owned by SYSTEM, the Flow will Run As Priyesh Wagh


Hope this helps!!

Here are some more Power Automate related posts you might want to look at –

  1. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  2. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  3. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  4. Accept HTTP Requests in a Flow and send Response back | Power Automate
  5. Terminate a Flow with Failed/Cancelled status | Power Automate
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  11. Text Functions in a Flow | Power Automate
  12. Using Parse JSON to read individual List Records in Flow|Power Automate

Thank you!!

Cancelled Bookings Imported in Time Entries in Dynamics 365 PSA issue | [Quick Tip]

Import Bookings is one of the important features provided by PSA for users to do Time Entries quickly and efficiently!

But out of the box, they also Import Cancelled Bookings!

Scenario

Now, let’s say we have some Bookings for a Resource and they look like this-

  1. These are the original Bookings for Priyesh on Tuesday and Thursday respectively i.e. 27th and 29th Oct 2020.

  2. Now, let’s cancel the 27th Oct 2020 booking. You can do so by right-clicking and changing the Status to Canceled. Once done, it will look like below –

  3. By default, when Priyesh tries the use the Import Bookings feature in Time Entries, he sees the below Canceled Booking as well.
    It can happen that the one who imports doesn’t recollect about the Canceled Booking and might Import it by mistake.


    To solve this, here’s what we do!

Resource Bookings for Time Entry Import view

So, here’s the view you care for.

  1. Open the Resource Bookings for Time Entry Import view as shown below

  2. In this view, change the Criteria

    The default criteria will look like below –
  3. Add another condition to it on top level i.e. the Booking Resource Booking entity itself for Booking Status field.


    Add this condition

    This should be it. Save and Publish your changes.

Correct Bookings Imported

With that small change, Canceled Bookings will not be imported for Time Entries.

Hope this helps!

Here are some more Dynamics 365 PSA (Project Service Automation) related posts you might want to look at –

  1. Change Booking Status colors on Schedule Board for Field Service/PSA [Quick Tip]
  2. Modify Project tab’s view in Schedule Board in PSA v3 | Quick Tip
  3. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  4. Additional columns in PSA v3 Schedule view
  5. Update Price feature in D365 PSA v3
  6. A manager is required for non-project time entries, absence, and vacation error in D365 PSA v3
  7. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  8. Booking Resources more than their capacity in D365 PSA v3
  9. Time/Expense Entry Rejection comments in D365 PSA v3
  10. PSA v3 View Custom Controls used on Project form

Thank you!

Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate

We can be a little creative and put Flow Bot to use in Power Automate’s Microsoft Teams connector! Let’s look at a use case where you can use it to make sure Task Reminders can be handled in a friendly way.

An Open Task

Let’s look at a typical Task in Dynamics –

  1. Let’s say there’s a Task set to Joe to have a meeting with Adam which looks like this in Dynamics.

  2. In this example, I’ll ask if the user forgot to mark it as closed since the time has passed.
  3. If the user is reminded that they actually worked on it but forgot to close, they can simply click on Mark as Complete right from Teams and not bother about going into Dynamics to close it.

Flow

Here’s how I constructed the Flow. It could be different in your case. I just wanted to put an example out –

  1. My Flow runs on Recurrence. Once a day to check whether any Tasks are left Open in the past 4 hours. Then it could be tasks from the previous day or anything older than 4 hours. (Not being stringent here 😊)
    Next, I’ll get all Tasks which are open over past 4 hours. Using Fetch Xml Query as I was comfortable doing that.

  2. Furthermore, in the Fetch Xml, I’m using Link Entity to get related data. I’ll need the record Owner’s Email address and I’m fetching it from User’s entity.

    To understand how to also read related records and use them as variables, you can follow Sara Lagerquist’s post on the same with a superb explanation – https://saralagerquist.com/2019/11/25/how-to-avoid-the-get-record-action-to-retrieve-related-data-in-power-automate/
  3. Post that, I’m Parsing JSON so that I can use fields later on in the Flow to put in the Flow Bot.

  4. Now, since the Get All Tasks will get all open Tasks from the system which may belong to other users too, an Apply to Each will open up to now treat each of these Tasks as a different Flow Bot message.
    This will loop through all the Parsed results from the step above so I can easily use fields from the Task

  5. Next, is the important step. In Microsoft Teams’ connector, you’ll find this Action called as ‘Post a choice of options as the Flow bot to a user’.
    As the name suggests, this Action can post buttons as choices to the user in their chat and capture responses. Simple!

  6. This Actions will demand the following details. My Flow bot card looks like this

    Now, the Options Item 1-, 2 etc. are the places where you can provide what all options the users can get to select.

    The Recipient above should be the email address of the Teams user who should get this Flow Bot. Hence, I had selected the FetchXML query above to get the Email address from the Owner of the Task itself and parsed it to select as a field in here.

    Finally, what should be the Message inside and the Headline. Which obviously will be read by the user to understand what the message is about. Hence, Description of the Task and Subject in them respectively.
  7. Later on, based on the response of the user, if they click on
    I’ll go ahead and mark the Task as Completed in Dynamics.

  8. And just set the Task record to Completed state.

  9. And that’s it. Yours can be even more basic or complex depending on how you want to use it.

Flow Bot

Now, every once a day according to above scenario, my Flow Bot will post the below message to the user’s Teams chat.

  1. You’ll see this card posted in the chat.

  2. Now, you have two options, Mark as Complete and This is Pending. Let’s say the user wants to Mark the Task as Complete. So selecting either of the options, you’ll get place to add Comments.

    I’m NOT doing anything to the passed comments, but you can do so based on your use case.
    Also, I’m NOT doing anything when the user clicks on This is Pending.

  3. On clicking Submit, the user sees as below and the buttons go away.

  4. And when you check the Task in Dynamics, it’ll be marked as Completed.

Hope this is useful to get your going! You can use this in several use-cases to capture something from the user through their Teams chat and update and forward it to other systems.

Here are some more Power Platform, Flow, Teams posts you might like to check –

  1. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  2. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  3. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  4. Accept HTTP Requests in a Flow and send Response back | Power Automate
  5. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  6. Terminate a Flow with Failed/Cancelled status | Power Automate
  7. Pause a Flow using Delay and Delay Until | Power Automate
  8. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  11. Using Parse JSON to read individual List Records in Flow|Power Automate
  12. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate

Thank you!

Turn Teams On / Off at Org Level, provisioning users | M365 Admin Center Tip

Here’s a tip you’ll probably need. You can quickly turn Teams On/Off at the Org level.

Typically, if the Teams is not enabled at the Org Level, you’ll see this error message

if you click on the Enable Teams button, it’ll take you to this Microsoft Docs page – https://docs.microsoft.com/en-us/MicrosoftTeams/office-365-set-up?WT.mc_id=DX-MVP-5003911

Turn Teams On or Off at Org Level

To skip searching through the Microsoft Documentation on turning Teams On at the Org Level, do the following –

  1. Go to the Microsoft 365 Admin Center, then look for Settings, expand it. Then, go to Org settings


  2. Now, look for Microsoft Teams in the list of Services. Click on it.

  3. Once the Teams’ Settings open, you can see that you can either enable the Team On or Off for all Users. Also, you can manage Guest Access as well.

Check Teams Provisioning Access

Post the above, there might be a few users or new users who might have been Teams provisioned through their licenses.

Here’s how you can check it –

  1. Use this link to check if Teams has bee provisioned to the users or not – https://admin.microsoft.com/AdminPortal/Home#/teamsprovisioning

  2. If not assigned yet, make sure you enable Microsoft Teams for the users by going into their Licenses and expanding Apps section.

    And then, look for Microsoft Teams

  3. Teams should then be enabled for Users.

Hope this helps. Here are some more Office 365 / Microsoft 365 Admin / Teams related posts you might want to check –

  1. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  2. Adding a Canvas PowerApp to Teams
  3. Import multiple Users in Office 365
  4. Office 365 Admin: Quickly Enable Multi-factor authentication for users
  5. Create new Sandbox and copy Production over to it in PowerPlatform Admin Center
  6. Restrict User Access to a D365 instance using Security Groups
  7. D365 Quick Tip: Audit User Access in Dynamics 365 v9 CRM

Thank you!

There are missing dependencies. Install the following solutions before installing this one: “Active” | Connection References missing in Power Platform Solution

While importing and Unmanaged Solution into another environment, you must’ve come across these error messages like “There are missing dependencies. Install the following solutions before installing this one: “Active”

Now, there are various factors as to why this error is seen. I’ll try to cover one of them. Missing Connection References! Let’s take a look.

So, out of other reasons, one could by that there are some Flow’s Connection References that are not yet added to the Solution when it was exported out.

Error on Import

Let’s say you trying to import this Unmanaged Solution in an environment.

  1. This is your Source Solution which you want to Export and Unmanaged and Import into other environment.

  2. You see the following error on Import.

  3. Now, there are many other reasons why you are getting this error. But, in this case, it’s about missing Connection References from the Source Solution

Adding Connection Reference

In my case, it was missing adding the Connection References in the Source Solution, so here’s what I did –

  1. Go to the Add existing in your source Solution

  2. Look for Connection Reference (preview)

  3. When I add that, I can select what all Connection References are available to add.
    Here, you’ll have to select all those Connection References which you have utilized in your Solution Components.
    To understand more on Connection References, here’s a post by Alex Shlega’s posts on Connection Reference – https://www.itaintboring.com/powerapps/connection-references/

  4. When you click that, it’s added behind the scenes. Now, export the Unmanaged Solution again.



Re-Importing into Source Instance

Now, In your Source Instance, re-import this newest Unmanaged Solution.

  1. Now, importing the 1.0.0.2 version, you’ll see no issues.

  2. And when you click next, you’ll be asked to Create a Connection right away

  3. In this example, I’m supposed to create a CDS (Current Environment) connection. Because that’s what I had selected as a Connection Reference while exporting from the Source Instance.

    Skipping a few intermediate steps. My connection is created as below.

  4. Going back to the Import tab where I was importing the Solution, I’ll just refresh as directed.

  5. Any my Connection is available.

  6. I can just continue to Import as usual and it’ll be imported.

Hope this helps!

Here are some more Power Platform related posts you might want to check out –

  1. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  4. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  5. Implement character length validation in a Canvas Power App | Power Platform
  6. Accept HTTP Requests in a Flow and send Response back | Power Automate
  7. Terminate a Flow with Failed/Cancelled status | Power Automate
  8. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  9. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  10. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  11. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  12. Setting Retry Policy for an HTTP request in a Flow | Power Automate

Thank you!!

Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench

You already know the GUID of a view, nothing surprising. But, you want to get what current view is active. Because at times, you want to compare and return values to a CustomRule based on what view is being set currently!

Let’s take a look!

Passing Parameter to JS function in Ribbon Workbench

Let’s assume the below scenario –

  1. You have a Ribbon button on the Account entity. And it looks like below.

  2. So here’s what you pass to the function that this button will call. No matter where that function is being called i.e. on Press of the button in Command or as a Custom Rule in an Enable Rule. You can pass this parameter called as PrimaryControl (If you are calling your function on selection of a record, you can even use SelectedControl and continue as is)

Reading GUID of the current view in Browser’s Dev Console

Now, let’s say you have a button on the selection of a Row or even on press of the button itself and it calls the function to which you’ve already passed PrimaryControl, here’s how you read it –

  1. Notice that the argument is passed, set a debugger; so that you don’t have to manually set breakpoints.

  2. Now, go to Console, and check this variable in which PrimaryControl is being passed. You’ll notice that _getCurrentView() is available for you

  3. Simply, select it in the function and press enter, you’ll see details inside.

  4. And you can simply read the id like you read an attribute.

Hope this helps!!

Here are some more Ribbon Workbench / JS / customization related posts you might want to look at –

  1. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  2. Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench
  3. Debug Ribbon button customization using Command Checker in Dynamics 365 CE Unified Interface
  4. Show Ribbon button only on record selection in Dynamics CRM
  5. Hide Custom Ribbon Button [Easy Way] – Ribbon Workbench
  6. Enable Flow button on D365 Ribbon
  7. [SOLVED] Navigating URL from Ribbon’s custom button in Dynamics for Phones app
  8. Fix Ribbon icons on the Unified Interface in D365 CE
  9. Create a New Record button for Activity Type entity using Ribbon Workbench: D365
  10. D365 Ribbon Button shortcut to open a Document in SharePoint Online

Thank you!!

Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service

Mostly, Gallery and Forms are used to work with CDS (Common Data Service) Entities data are in Dynamics 365 like Accounts, Contacts, Opportunities etc.

Some of the common field level metadata info you can retrieve is: MinValue, MaxValue, MaxLength of a field. This is dependent on whether it is supported/provided by Data Source itself, be it CDS or any other Data Source, depends.

You can leverage DataSourceInfo function to enrich your CDS form in a Canvas Power App by showing some metadata about fields. Something like below –

DataSourceInfo function

DataSourceInfo is a function that provides some info about the DataSource itself or the columns present in the Data Source.

Not necessarily all DataSources will provide all information.

In this post, I’m trying to show some metadata of the Dynamics 365 using CDS Data Source.

Microsoft’s official documentation on DataSourceInfo https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datasourceinfo?WT.mc_id=DX-MVP-5003911
In my example, I’ve added some labels to show these values.


MaxLength

MaxLength is used to show the maximum allowed capacity of a field. Most useful to show the maximum length of lengthy fields such as a Multi-line Text Field in Dynamics 365 CRM.

  1. Let’s say Description field in Dynamics 365 has Length provided as 600

  2. I’ve placed maxLen label below the Description field

  3. And the formula is to show the info “Max Length: <value>” is written using Concatenate() function so that I can add some text as I want to make it look more informative.

    In the above formula, in Text() function, I’ve written
    DataSourceInfo in blue. That is the formula that will take arguments like Data Source, DataSourceInfo.<Function> & Column name.
    Accounts marked by showing orange arrow is the Data Source itself since it is connected to Accounts entity in Dynamics 365.
    MaxLength is the attribute which will tell us the Maximum allowed length for the field we will enter next.
    “description” denotes the name of the column in double-quotes of which we want to know the MaxLength.

To enrich this feature, you can use this to dynamically show how much more characters are remaining in real-time as the user types into the field. Refer this post – Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform


MinValue & MaxValue

MaxValue & MinValue are used to show the minimum & maximum value allowed in the field. Most apt is having Numeric fields in Dynamics 365 CRM.

  1. Let’s say Grading is a custom field called as Grading which is Whole Number.

  2. I’ve placed minVal and maxVal labels below Grading field in the Canvas Power App.

  3. And the formula is to show the info “Min : <value>” & “Max: <value>” is written using Concatenate() function so that I can add some text as I want to make it look more informative.

    In the above formula, in Text() function, I’ve written
    DataSourceInfo in blue. That is the formula that will take arguments like Data Source, DataSourceInfo.<Function> & Column name.
    Accounts marked by showing orange arrow is the Data Source itself since it is connected to Accounts entity in Dynamics 365.
    MinValue and MaxValue is the attribute which will tell us Minimum & Maximum allowed data values for the field user can enter  in the field in the next parameter.
    new_grading denotes the name of the column in double-quotes of which we want to know the Minimum allowed Value and Maximum allowed Value.

Hope this is useful!

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

  1. Restore older version of a Canvas Power App | Power Platform
  2. Debug Published Canvas Power App with other users using Monitor | Power Platform
  3. Download a File from a Canvas Power App using a button | Power Platform
  4. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  5. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  6. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  7. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  8. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  9. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  10. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  11. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  12. Correctly connect to an Excel file in a Canvas PowerApp

Thank you!!

Calendar View for Work Order Bookings in Field Service | Wave 2 2020 Update [Early opt-in]

So here’s a nice improvement to see your Bookable Resource Bookings in a Calendar View as a part of the 2020 Wave 2 Update for Field Service!

Disclaimer: his is a preview feature and is planned, it’s no guarantee that this feature will make it to the final release of Wave 2 Updates.

Pre Requisites

  1. Make sure Wave 2 2020 Updates are available to your either via Early Opt-in or having directly applied to Org if you’re reading this from the future 😊

    Here’s the Microsoft Docs official link for the same – https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave2/service/dynamics365-field-service/calendar-view-booking-work-orders?WT.mc_id=DX-MVP-5003911

Switch to Calendar View

Here’s how you can leverage the Calendar View control for the Bookings.

  1. When you are in your Bookable Resource Bookings view, you might not have this view by default. So, you look to switch the view.
    look for Show As option on the ribbon button

  2. Now, you can see that a BookingCalendarControl is available for you to select.

  3. Once your switch, you’ll see the Calendar Control on the view with the Bookings arranged in a Calendar like control
    The default Month view looks like below

  4. You can even switch to look at 2 other views, Week and Day views.


  5. The Day view looks like below

  6. And the week View looks like the below

  7. Selecting the Booking will simply open the record in Dynamics as usual.
  8. And this is how you see it on the phone.

Config Options

To first address the most important question, it’s isn’t enabled by Default.

  1. But, you can make it defaulted on the Web application of Dynamics by changing it at the Entity level as shown below.

  2. These are the Properties that can be configured.

    Hope this was helpful!!

Here are some more Dynamics 365 / PSA posts you might find useful –

  1. Change Booking Status colors on Schedule Board for Field Service/PSA [Quick Tip]
  2. How to add Rating Values to Rating Models in D365 Field Service and PSA
  3. A manager is required for non-project time entries, absence, and vacation error in D365 PSA v3
  4. Modify Project tab’s view in Schedule Board in PSA v3 | Quick Tip
  5. Restrict User Access to a D365 instance using Security Groups

Thank you!!

Debug Published Canvas Power App with other users using Monitor | Power Platform

At times, users report that they can’t seem to know what’s wrong with their published App and the behavior is said to be unexpected. At times, no direct error is thrown to them but they don’t seem to understand what’s wrong.

Here’s what we can look at and invite them to join a Remote debugging session.

Open Monitor

In your Canvas Power App, you can find Monitor (which is in Preview as I write this post), this will open a new Monitor interface.

  1. Click on the Menu as shown

  2. Alternatively, also from the list of Apps available to you by permission.


  3. Now, when you open it, you’ll be in the Debug interface. In the interface, look for this open to Play Published App

  4. It’ll open the actual App in Play mode in the new tab.
    On the new Tab, you’ll see this message to ask you if you want to Join the session.

  5. Once you click on Join, the App will open with the message on top saying that you’ve joined the debug session.

  6. Let’s say I do a simple data entry operation by select one of the records and trying to modify it.


  7. As you then perform Actions in your App, your operations will be captured in the Monitor for you to review and debug what’s wrong.

  8. Also, if there are any specific errors that occurred, they are highlighted with Red row. You can simply click it and the details will appear on the right.

  9. Error can be investigated as below

  10. You can then investigate and see what was sent and how the payload was etc. and work towards further debugging/investigating it.

Invite Others to Debug session

Also, if you want others to simply look at what’s being captured. You can invite other users to your debugging session by clicking on Invite button

Enter their Email address and they’ll show up in the list. Copy the Link from their row and pass it on to them to join the session. They will be in read only mode and can see what’s captured and look at error details.

They can only watch and not Play the App themselves or invite others. See below

Hope this helps!!

Here are some more Canvas Power App based posts you might want to check –

  1. Implement character length validation in a Canvas Power App | Power Platform
  2. Download a File from a Canvas Power App using a button | Power Platform
  3. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  4. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  5. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  6. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  7. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  8. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  9. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  10. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform

Thank you!!

AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List

At times, you want to do a quick calculation but the Data Source doesn’t have that column present.

Example, you’re populating some data from a SharePoint List which is a Scoreboard. But it doesn’t tell the difference between the current Score and Top Score.

So, to find how many points does the Score trails by the Top Score. To do that, we’ll dynamically add a Column to our Data Table in a Canvas Power App by using AddColumn() function.

SharePoint List & Canvas App

First part is the list itself which you already saw above, I have the below Canvas App –

  1. The only thing I have in this Canvas App is a Data table which I named as ScoreBoard

    Which will look like this

  2. I’m setting the Data Source of this Data Table to be DynamicList and not the actual SharePoint List. Because, in order to create a dynamic column, I should be using Collections in this demo and I can’t use the SharePoint List as Data Source directly.

  3. And to write my function, I’ll also add a Button so that on click of which, I can populate my internal Data Source in this case which is Collection called as DynamicList to be populated with data. You can use any other way as suitable.

AddColumns() function

  1. Since I want to generate my dynamic column, I’ll first use ClearCollect() method to add the SharePoint List with the dynamic column to my Collection which I’ll call as DynamicList.
    All this OnSelect of the Button which I added.

  2. The formula goes as below
    ClearCollect(<NameOfCollection>, AddColumns(<ActualDataSource>,”ColumnName”,<Expression>))

    In the above formula,
    ClearCollect(DynamicList) is being created to create a Collection called DynamicList and Clear if there’s any pre-existing data in it before populating fresh data.
    AddColumns(Scoreboard,”Trial By”, ‘Top Score’ – Score) – Scoreboard is the actual SharePoint List I’m using which doesn’t have the column, Trial By is the dynamic column I’m creating. And my expression is Subtract Score from Top Score so that I get the difference.

  3. Make sure you select the columns. Perhaps once you run in in your browser, and try to click the button, the column will be available for your selection in the below Edit Fields section. [I had to do a little back and forth, perhaps you might have a smarter way 😊]



    Here’s Microsoft Docs on the function – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping ?WT.mc_id=DX-MVP-5003911

Run

Now, when I run the app, and click on Load Scoreboard button, I see the below data populated with by dynamic column Trail By.


Hope this was useful.

Here are some more Power Automate / Flow posts you might want to check

  1. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Text Functions in a Flow | Power Automate
  11. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  12. Get Count of records retrieved in CDS connector in a Flow | Power Automate

Thank you!

Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Now, for all the newbies working with Common Data Service (Current Environment) connector face a little constraint in order to read certain fields which are NOT in the list of the Dynamic Content of the CDS connector itself.

Scenario

Let’s say you want to read this field from the Body / Outputs of the CDS trigger in a Flow in Power Automate

Attributes (or rather supporting metadata) won’t be accessible directly since it’s not from the context of the CDS connector itself like you see for other fields as below –

Flow

In this example, here’s how our Flow will look like.

We’ll declare 2 variables after the CDS connector with Create or Update trigger on Accounts entity and how we can work with the results.

Reading from triggerBody()

When to use triggerBody() ? – When you want to fetch attributes from the body of the trigger.

Here’s how you can use triggerBody() function to read ‘RunAsSystemUserId’ from the outputs of CDS connector.

  1. Let’s say you have a variable declared to store your results. Let’s call it Trigger Body. Click on the fx sign to enter the formula

  2. Now, in the formula, enter triggerBody()?[‘RunAsSystemUserId’]. triggerBody() is a method to you’ll find it in auto-complete

  3. And the variable will look like this

Result of triggerBody() will be as below

Reading from triggerOutputs()

When to use triggerOutputs() ? – Whenever you need to access anything from within the body as well as some info from the header as well as shown in the 2nd screenshot in step #2 below.

Here’s how you can use triggerOutputs() funtion to read ‘RunAsSystemUserId’ from the outputs of CDS connector

  1. Let’s say you have a variable declared to store your results. Let’s call it Trigger Output. Click on the fx sign to enter the formula


  2. Now, in the formula, enter triggerOutputs()?[‘body/RunAsSystemUserId’]. triggerOutputs() is a method to you’ll find it in auto-complete.


    The reason this we write “body/RunAsSystemUserId” is because in the JSON structure of the complete Outputs of the CDS Connector, you’ll see that RunAsSystemUserId attribute lies inside body in the JSON.
    Whereas in terms of triggerBody() above, we are reading attributes from the “body” itself.

Result of triggerOutputs() will be as below

Hope this was useful!

Here are some more Power Automate / Flow posts you might want to check –

  1. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Text Functions in a Flow | Power Automate
  11. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  12. Get Count of records retrieved in CDS connector in a Flow | Power Automate

Thank you!

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!

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!

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!

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!


Accept HTTP Requests in a Flow and send Response back | Power Automate

Let’s say you want to create a consumable HTTP service, do some operation and send back Response. Here’s what you can do.

You can create an HTTP Request Trigger to receive the HTTP request, process the request and send back a Response.

Accept HTTP Request in Flow

Let’s create a listener first, so that we can get the URL to be used and ask users to submit on that URL.

  1. In your connectors, select the below connector ‘When an HTTP request is received


  2. This will let you accept HTTP requests of different methods. First, let’s just create the schema. Assuming you know what schema you are accepting, click on ‘Use sample payload to generate schema‘.


  3. Now, enter your sample data and click Done.


  4. Schema will be generated automatically.

  5. Now, save your Flow so that a URL could be generated.


  6. Also, remember to select what type of Request to accept. It’s under the Show advanced options

  7. Select what type of HTTP request this is. In this example, I’m accepting a POST request.

    relativePath is used when you want to access a specific resource in your HTTP request that is passed in the query string. None in my case, hence, not using it.
  8. Supported verbs in the HTTP Request trigger are GET, PUT, POST, PATCH, DELETE –

Process Info

This is subjective and is completely based on your use case, you can decide what you want to do with the data you receive. Could be anything!! I’ll simply highlight in short what I’m doing here.

I’m just accepting all “Requests” entity data and giving back a Reference ID to customer telling them that their request has been registered with us. Like a typical Ticketing system where you log a ticket and you get back a reference number.

In my example, I’m simply creating a CDS record in my D365 environment and I will return the Auto-generated field value to the Response so that it can be sent back to the caller.

In case you are also looking to create an Autonumber field for yourself in CDS, you can check this post – AutoNumber field in CDS | PowerApps

Send Back Response

Now, in the step above, I’ve created a CDS record in the system. It will also auto-generate a number for the record. I’ll use the same to pass it back as a response.

  1. Now, search for Response (or rather Request) in the Connectors list and you’ll be able to choose the Response action.


  2. In the same, you can then choose what Response code you want to return. This will differ based on where you use this. Example, if you use this Response Action in case of some error, you can return 500 or 404 if something was not found, depends.
    In this case, I’m returning 200 OK and the JSON of my message and sending back the Token (Auto-number field on Request entity record creation)

  3. Here, my Flow is complete.

Testing the Flow

Understand the building blocks of the Flow. Accept Request –> Process –> Response.

Now, the URL we get when we save the Flow is the one that goes to the developers/consumers.
It contain some tokens and header information.

See how I tested it using Postman.

  1. Once I copied it from the Flow and pasted in Postman, the Headers were populated automatically in Postman. (And then you can use this to build your code later on)


  2. Now, I am sending the data in the body in the following way

  3. Now, let’s say I submit the request using Postman.
    A record will be created in my D365 (Common Data Service)

  4. And the Token that the record generated will be returned as response back to Postman

    With the status of 200 OK

  5. And that’s how you can receive HTTP requests and send back responses using Flow in Power Automate.

Here are some more Power Automate / Flow posts you might want to look at

  1. Make HTTP request from Flow in Power Automate
  2. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  3. Terminate a Flow with Failed/Cancelled status | Power Automate
  4. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  5. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Get Count of records retrieved in CDS connector in a Flow | Power Automate
  10. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  11. Switch-Case in a Flow | Power Automate
  12. Using Parse JSON to read individual List Records in Flow|Power Automate

Hope this was useful! 🙂

Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists

Adaptive Cards is something so cool and works like magic!! I’m sure there are so many creative ways to use it.

Here’s an example – Use Adaptive Cards to gather data from Microsoft Teams Users and populate it automatically to SharePoint List.

Scenario

Let’s say, you have a set of data to collect from your employees – for instance, planning a trip (or any other event for that matter) where you have to take data from employees in order to better plan the logistics.

So, in my example, I want to plan an event for which I need to ask each employee their T-Shirt size, food preference and any allergies to be taken care of.

It’s better to let the users answer at their own accord. You simply need to create a SharePoint list and list out all the Employees whom the short questionnaire should be sent to.

Adaptive Cards (https://adaptivecards.io/)

As their website says, Adaptive Cards are platform-agnostic snippets of UI, authored in JSON, that apps and services and open exchange.

It’s a superb way to make these cards pop-up in Teams, Outlook, Bot Framework etc.

In this post, we’ll ask Microsoft Teams users to submit some info which will be automatically populated to the SharePoint List.

In https://adaptivecards.io/designer/, you can design your own Adaptive Card by looking at the samples already provided on the website.

SharePoint List

Let’s say, you’ve prepared a SharePoint List called ‘Employee Preferences‘ which looks like the below. And you need to get info from them on their Allergies, Food Preference and T-Shirt size in order to prepare for the event

Power Automate

Next step, is to create a Flow in PowerAutomate to send out these Adaptive Cards to the Teams member in their Chat so that they can send back their preferences which is automatically updated in the SharePoint List.
Let’s begin –
(Before we begin, it’s up to you to decide when should the Power Automate trigger, whether on create of Each Item, or all at once when the SP List is ready. I just chose the later. So, see what’s most suitable to you.)

  1. Let’s say my first step is to get all the items from the SharePoint List I created, called ‘Employee Preferences


    And then, set the below preferences –


  2. Next, I’ll loop through each of the SP items and initiate an Teams action to send Adaptive Card and wait for the response.

  3. Now, in Adaptive Card you’ve selected for the user of the Team, I’ve used the Email field from the SP list so that I can use it in the recipient field to send the Adaptive Card to that Teams user.

    And paste the content from Adaptive Card editor in Message field.


  4. You can use dynamic data at the right places to populate you Adaptive Card wherever needed.


  5. Finally, you can have an Update message filled in. This is shown once the User Submits back the Adaptive Card with data.
    Should update card should be selected to Yes so that it doesn’t stay like that and the user knows that the response has been captured.


  6. Then, you need to update the captured response back to the SP List.



  7. At this point, your Adaptive Card is ready! Let’s test.

Adaptive Card in Microsoft Teams

Once this is run, the Teams user gets the below in the chat.

  1. User receives and Adaptive Card in their Teams Chat.

    Let’s zoom a little and see how it looks. Notice that we had populated the name dynamically in the Adaptive Card body.

  2. Now, click on Fill Out information and the card will expand to expose the form

  3. Now, I’ll fill the information as below and Submit the same

  4. Once I click Submit, I’ll see the below message. Remember, this populated from Update message field in the Adaptive card options.

  5. And when you check back the SharePoint List, the data has been updated in the same.

    And that’s it!!
    Hope this helped!

Here are some Power Automate / Flow posts you might want to look at –

  1. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  2. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  3. http://flowPause a Flow using Delay and Delay Until | Power Automate
  4. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  5. Text Functions in a Flow | Power Automate
  6. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  7. Get Count of records retrieved in CDS connector in a Flow | Power Automate
  8. Number Formatting in a Flow | Power Automate
  9. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  10. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  11. Switch-Case in a Flow | Power Automate
  12. Make HTTP request from Flow in Power Automate

Thank you for your time!

Aggregate functions in a Canvas Power App | Using on SharePoint Lists

Aggregate functions have one of the most common applications while building your Canvas Power App.

In this simple example, we’ll try to make common Aggregate Functions like Max, Min, Sum & Average work.

There are 2 more advanced Aggregate Functions, StdevP for Standard Deviation and VarP for Variance. (It might not make full sense in this post, but I added them anyway to see how we can apply for formula 😊 I’m sure your use-case will make more sense!)

SharePoint List

Let’s say, my SharePoint list looks like this. Scores of some people and their ranks

And I’m using Data Table to populate this into my Canvas Power App

Formulas

Here’s how I used for Formulas to use the Aggregate functions on the SharePoint list data I populated in my Canvas Power App

For all the Formulas above, I’ve written them inside a Concatenate function just so I could add some Text and then use the formulas. You may use differently.

In my case, the Formula goes like this –
Function(SharePointListName, ColumnName)

“Max” – Maximum Number in Score column of Scoreboard list


“Min” – Smallest Number in Score column of Scoreboard list

“Sum” = Total of all values in Score column of Scoreboard list

“Average” – Average of all values in Score column of Scoreboard list

“StdevP” – Standard Deviation arguments passed. Score column in this case

“VarP”-Variance of the arguments passed. Score column in this case

And that’s it! I tried to simply the explanation. However’s there much more to consider as well. Here’s the full documentation by Microsoft – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates

You might want to check some posts on Canvas Power Apps as well –

  1. Count of total CDS records returned in a Canvas Power App connection [Quick Tip]
  2. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  3. Restore older version of a Canvas Power App | Power Platform
  4. Implement character length validation in a Canvas Power App | Power Platform
  5. Logged In User details in a Canvas Power App
  6. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  7. Variables in Canvas Power Apps | Global and Context
  8. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  9. Sending Image from Canvas PowerApps to SharePoint Document Library using Flows
  10. Correctly connect to an Excel file in a Canvas PowerApp

Hope this was helpful!

Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM

At times, ever wondered what happened to the Mailbox? You ran some tests, you also got results, but the Alerts section is empty or not generating Alerts.
undefined

Here’s what’s missing and how the behavior is –

Turn on Mailbox Alerts

In System Settings, you can turn on what type of Mailbox alerts should be shown.

Navigate to Email and scroll down. You can then choose what type of info should be generated in Alerts area in a Mailbox. Error, Warning or Information.
undefined

Behavior

Now, the behavior is a little confusing. Here’s what it is –

  1. Any previously generated errors will show if the setting was On initially and was later on turned off down the line.
    In my example, the last error was generated on 1st July 2020
    undefined
  2. Now, I turned the setting Off
    undefined

  3. And post that, if there are any new errors/messages, they won’t show up
    undefined
  4. But, after I turn the settings back on
    undefined
  5. New errors after that will start showing up again.
    undefined
  6. Meaning, the duration in which the Alerts are off, those will not be generated. And the duration in which the Alerts are On, they will keep populating the Alerts section.

Hope this was useful.

Here are some more Dynamics 365 CRM related posts you might want to look at –

  1. Viewing Emails as conversations on the Activity Timeline in D365 CE
  2. Create & Send PDFs from Word Templates for Quotes in D365 CE Wave 2 Updates
  3. Summarizing D365 App For Outlook Setup in 3 steps with Exchange Online mailbox
  4. Create a support Queue in Dynamics 365 CRM
  5. Quick Tip: Cleaning Queue Items
  6. Dynamics 365 Solutions’ New Experience in Power Apps, Solution Checker and more
  7. Easier template selection & Manage Activities with ease in Dynamics 365 | 2020 Wave 1 Feature
  8. Custom View Filter JS code not working in Dynamics 365 CE. Why? [Quick Tip]
  9. PSA v3 View Custom Controls used on Project form
  10. Modified By (Delegate) & Created By (Delegate) in D365

Thank you!!

Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform

Most useful scenarios is to create what we commonly call as “Dependent OptionSets” in Dynamics 365 context.

Scenario

Here, Country and State are 2 entities in CDS. Each Country has N states i.e. Country is a parent entity of State entity.
undefined

We’ll create 2 Drop-downs in a Canvas Power App i.e. 2 OptionSets namely Country and State that selection of Country will affect what should be populated in State entity. Simple!
undefined

Setting up your Drop-down controls

Let’s see how the drop-downs are set.

  1. Drop-down 1 is populated from Countries entity in CDS (Common Data Service)
    undefined

    undefined
  2. For State to be filtered based on the Country, we’ll use Filter() function to show records based on what Country is selected in Drop-down 1.
    For Items of the Dropdown2 control, we’ll write the below formula
    undefined
    undefined

    So, the Filter([EntityToPopulate], ‘[LookupFieldNameOfParent]’.[EntityOfParent]) = [DropdownControl].Selected.[GUIDFieldOfParentEntity])
    Sorry, it’s a little rough on the eyes!
  3. And it will give you the below. Select Country first
    undefined

    select your parent record
    undefined


    Then, the drop down will populate child records based on the Country. So the States will show up which have lookup to India as Country.
    undefined

And that was it!

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

  1. Restore older version of a Canvas Power App | Power Platform
  2. Implement character length validation in a Canvas Power App | Power Platform
  3. Logged In User details in a Canvas Power App
  4. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  5. Variables in Canvas Power Apps | Global and Context
  6. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  7. Adding a Canvas PowerApp to Teams
  8. Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

Hope this helps!!

ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate

Often times, if you are using Child Flows and but you see some unexpected while Saving your parent Flows upon adding a Child Flow, which usually look like the below
undefined

Assuming, you are aware of using Child Flows and that they can only be created inside a Solution. (Of course, that’s why you could encounter this issue since you’re able to set a Child Flow already 😊)

Reason Issue

Let’s say this is your Child Flow as shown below in Power Automate. It uses a connection for Approvals. (It could be any other connection in your case.)
undefined

Now, open Run only users section as shown below
undefined

It’ll show that my Approvals connection is relying on Provided by run-only user in Power Automate. To learn more about Run only Users, refer this post – https://www.serverlessnotes.com/docs/sharing-flows-as-owners-and-run-only-users

Now, I switch to Use this connection (<Connector>)
undefined

It’ll ask for a confirmation as per below
undefined

Once this is set for all respective connections, you’ll have no issues in adding a Child Flow to your parent Flow and saving your parent Flow!

Here are some more Power Automate / Flow posts you might want to look at –

  1. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  2. Pause a Flow using Delay and Delay Until | Power Automate
  3. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  4. Get Count of records retrieved in CDS connector in a Flow | Power Automate
  5. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  6. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  7. Number Formatting in a Flow | Power Automate
  8. Text Functions in a Flow | Power Automate
  9. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  10. Make HTTP request from Flow in Power Automate

Hope this quick tip helps!

Excel Importing Notes (Annotation) entity in Dynamics 365 CRM

Preparing an Excel Template for Notes entity is a little tricky. Doesn’t work when you just Export directly as a Template from the Templates Wizard and try to include all columns and import as is. Why? Because there’s no Regarding field exported when you export/import that template.

undefined

Here’s what you can do as a workaround.

Scenario

Now, let’s assume you want to Export a standard Excel Template for import so that you can re-import into Dynamics for Notes entity for a regarding entity.

Exporting Excel Template

Your Document Templates are where all your Excel Templates can be exported from –

Now, follow the below –

  1. Select Notes entity and Edit Columns you need to Export the Excel with your required columns

  2. Select the columns you need. Observe that you don’t get Regarding column to export


  3. Then Download the file.

Modifying the Excel

Now, since you don’t have the Regarding field in the Excel you exported from Templates, here’s what you need to do –

  1. Add a column yourself, give it a proper name based on what the Notes’ Parent entity should be. In this example, I’m importing Notes for Account. So, I’m adding a column called ‘Account Name’


  2. A new column will be created as below

  3. Now, populate your data based on how the Notes should be imported and tagged to which records.

  4. Now, by default, this template is exported in Microsoft Excel Worksheet (xlsx) format. You’ll need to Save As in CSV format

Re-Importing

Up until above, your Excel is ready to be imported. Let’s begin –

  1. Import the file as a usual Excel Import in Dynamics 365 CRM. Since this is not a direct Template importing as is, but a CSV, you’ll get to map this file manually.
    undefined

  2. Then, you’ll need to manually select the Note entity from the drop-down and then proceed
    undefined

  3. Now, whatever is mapped automatically will be mapped. For the newly created Account Name field, you’ll need to expand the Not Mapped dropdown and select Regarding (Lookup)
    undefined
  4. Now, you’ll need to select the entity you want the Notes to appear under. In my case, this is Accounts, so I have it right there
    undefined
  5. Since this Regarding fields supports several entities, scroll all the way down to Confirm your selection
    undefined

  6. Now, your Regarding field is set and you are ready to confirm and Import
    undefined
  7. Now, my Import here is completed. (You’ll need to take care the Import is successful)
    undefined

Imported Notes

If you look at the records now, the Notes will be attached to the respective Regarding records
undefined
undefined

Here are some more posts on D365 CE you might want to look at –

  1. Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench
  2. Refresh button missing on Roll-Up fields in D365 UCI? Quick Tip.
  3. Check Managed Solution failures in Solution History in D365 CE
  4. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE
  5. Create a support Queue in D365 CE
  6. What is “Does not support untyped value in non-open type” ODataException in creating records in D365 CE?
  7. Set Lookups in Xrm.WebApi D365 v9 correctly. Solving ‘Undeclared Property’ error
  8. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  9. Modified By (Delegate) & Created By (Delegate) in D365
  10. Qualify Lead in D365 CE: Select which entity records should be created

Hope this helps!!

Global Notification in Dynamics 365 Unified Interface App [Preview]

Here’s a great feature to add a warning/error notification which is scoped globally unlike setFormNotification() which is commonly used and remains within a form itself.

Xrm.App.addGlobalNotification(notificationObject).then(success, error); serves this purpose. Let’s see how –

Disclaimer: Please be aware this is a preview feature yet and I’ll update on this post once this is out of preview.

This is only available for the Unified Interface.

Scenario

Let’s say you have opened an Account form and you want to warn the user in case they are working remotely with someone and might have their screen shared. You want to show a message like this –
globalNotif

And even if they navigate away from the form, it will remain on the screen since it’s scope is global.
navigatedOtherPlaces

Or, user can chose to close it manually which appears at the end of the strip on top-right corner.
canCloseIt

You can also optionally add a button and make it navigate to another URL in case you want to share more info with the users (In my example, I redirected to https://www.microsoft.com/en-in/) –
learnMoreButton

Example

Xrm.App has 2 methods to do the needful –

Xrm.App.addGlobalNotification(notificationObject).then(success, error) & Xrm.App.clearGlobalNotification(notificationObject).then(success, error)

In my scenario, I want to trigger the warning message as soon as the user wanders into one of the Account records. So, in my case, I’ve registered the method onLoad of the Account form itself.
Here’s the code in my JS file for the same –

Some notes before we proceed with the code –

  1. type in the notification object is supported as 2 at the moment and no other types are supported.
  2. The levels are as below
    1. Success
    2. Error
    3. Warning
    4. Information

account = {
globalNotification: function () {

var learnMoreAction =
{
actionLabel: “Learn more”,
eventHandler: function () {
Xrm.Navigation.openUrl(“https://microsoft.com&#8221;);
}
}
var notificationObj =
{
type: 2,
level: 3, //warning
message: “Please make sure you are not sharing your screen!”,
showCloseButton: true,
action: learnMoreAction
}

Xrm.App.addGlobalNotification(notificationObj).then(
function success(result) {
console.log(“Notification created with ID: ” + result);

// More code here
},
function (error) {
console.log(error.message);
// handle error here
}
);
}

};

I’ve registered the Function as account.globalNotification. You can directly use globalNotification is you are writing function directly as function globalNotification() {}

fnAdded

This notification remains App-wide unless closed by closed by a user of closed using clearGlobalNotification method as mentioned by Microsoft.

Source documentation by Microsoft is here – Xrm.App

Since we are transitioning into Unified Interface, here are some other related posts that you may like looking at –

  1. D365 Quick Tip: Why BPF wouldn’t appear in D365 Unified Interface?
  2. Fix Ribbon icons on the Unified Interface in D365 CE
  3. Change the Unified Interface App Icons
  4. Unified Interface App URLs – 3 different ways

Hope this helps!!

Kanban view in Dynamics 365 Sales | 2020 Wave 1 Early Access Feature

Kanban View in D365 is another desired feature for Dynamics 365 Salespeople is here in the 2020  Wave 1 Early Access feature-set!

Disclaimer: Before we proceed, please note that this is a part of the Wave 1 2020 Early Access. We can’t be sure if this will make it to the final release. Also, you can enable Early Access into your Sandbox instance only and test since it’s not recommended for Production at this point.

Enabling Kanban View

  1. Navigate to Opportunities and open the My Open Opportunities view
    openOppView
  2. Then, select Custom Controls to change to a Kanban view
    selectCustomControls
  3. Select Kanban and make sure it’s selected for all device types
    selectKanban
    clickOK
    Finally, just Save and Publish.

Using Kanban View

Now, once changes are published, on your My Open Opportunities view (you should already see it in Kanban). If not, select the Show As to show Kanban as an option and then select Kanban.
showAs
selectKanbanFromView

Once done, you can select the Kanban type i.e. based on Business Process Flow or based on the Stage of the Opportunity.
toggleType

How to Read the Kanban View

In the below, screenshot, the value denotes the total of the relevant Amount in that stage. Say, total of Estimated Revenue when an Opportunity is Open and the one on the right denotes total records that can be currently seen against how many records are actually present in that stage
howToView

Based on Status

Now, the Kanban view based on Status will let you move your Opportunity between two statuses. Say, in this example, the status is in Open, you want to mark it as Won.
dragStatus

And when you drop it on the Won status, the Opportunity Close dialog will appear where you can just fill in the required information and just close.
dialogToFill

Based on Business Process Flow

And in Business Process Flow type, you can just move the Opportunity between different stages of the BPF

bpfType

Moving the card to either direction will open up the actual record itself to make the final change.

Hope this post helps you get started!! 🙂

Save generated PDFs to SharePoint directly – 2020 Wave 1 | Early Access Feature

With Wave 1 of 2020, Early Access lets you use fantastic features in Dynamics 365 CE. For Sales customers, this little feature will definitely be a delight!

Disclaimer: Before we proceed, please note that this is a part of the Wave 1 2020 Early Access. We can’t be sure if this will make it to the final release. Also, you can enable Early Access into your Sandbox instance only and test since it’s not recommended for Production at this point.

Let’s start! Till now post Wave 2 2019, you were able to generate PDF Documents from the Document Templates you created for entity records. You can now take it a step further by having to choose between just downloading the file or Saving it to SharePoint directly behind the record.

Pre-Requisites

  1. SharePoint Integration enabled in D365
  2. Generate PDF option enabled for the entity record you want this feature on.
    If you are looking to enable this feature, check this post – Create & Send PDFs from Word Templates for Quotes in D365 CE Wave 2 Updates
  3. Wave 1 2020 Enabled for your Sandbox Organization.

You don’t need to perform additional settings for enable/disable this feature.

Creating PDF

  1. Just as you used to create a PDF from Wave 2019 updates, you need to do the same.
    createQuote
  2. And you’ll be prompted if you want to also save it to SharePoint.
    saveRec
  3. Once successful, you’ll see that it was saved to SharePoint.
    savedToSP

 

Saved to SharePoint

You can check the Documents grid, the Document will be attached there –
DocView
onSP
In this scenario, it won’t do both -Download and Save to SharePoint.

Hope you find this feature helpful!

Create & Send PDFs from Word Templates for Quotes in D365 CE Wave 2 Updates

And as we continue to ride on the Wave 2 October release features of the D365 for Sales, here’s a much anticipated feature Salespeople have been asking for. The ability to send Quotes as PDF (derived from Word Templates) right from the Quote itself.

At the time of this blog, I had enabled the Wave 2 Updates on the trial instance. Kindly try the same in your Sandbox instance first.

If you’re looking to enable Wave 2 Features for your organization, check this post –  Early Opt-in for October 2019 Wave 2 Updates.It is recommended you try these features on the Sandbox first.

Enable PDF Generation

As a part of the Wave 2 feature, you’ll need to enable this in the App Settings in the Sales Hub (typically).

  1. Navigate to App Settings
    appSettings
  2. In App Settings, look for PDF Generation area as shown below, You’ll notice that the feature might be turned off.
    settingOff.png
  3. You’ll simply need to turn it on and then Apply the changes.
    settingOn
  4. That’s it. You’re all set to use it. You’ll now see the 2 new buttons to Create PDF or Email as PDF.
    newButtons

    When this feature isn’t enabled, you won’t see the buttons –
    noButtons

Generate PDFs only

  1. Now, as the name suggests, if you chose to only Create a PDF out of the Word Templates you already have in place, simply drop down the menu and select the template you wish to get the PDF of.
    createPDF
  2. And the browser will throw a file in your system like any other download.
    downloadedPDF.png

Send Directly in Emails from Quote entity

  1. Typically, once things look good, you want to just send out the PDF as an attachment in an email from Dynamics. This button will let you do just that –
    emailAsPDF
    As you observe, this also works with your personal Word Templates too.
  2. Once you click on the Template, an email is ready for you to start writing and send when ready with the template attached as PDF already.
    draftedEmail

There are also some smart emailing capabilities that let’s you send email right from the context of the record. Check this post of mine for the same: Contextual Email communication in D365 CE Wave 2

Hope this helps!

Nested Editable Grids in D365 CE v9 UCI

Nested Grids – as the name suggests is a grid-within-a-grid (or rather, Grid-ception!). Nested Grids will let you expand a sub-grid entry to look at another grid of the expanded record. This depends on how you configure it.

Be aware, Nested Grids work with Editable Grids and only for Tablet, Phones and Unified Interface. This is not available for the classic Web UI.

Configuring Nested Editable Grid

Here’s my entity structure – I have Account, having multiple Contacts and each Contact, having Opportunities under them. Like in the below diagram –

relationships

Now, I have a Contact grid on my Account form (just like we usually do).

  1. I now will have to choose the grid to be a Editable Grid Control as follows. Also, click on the Nested grid view control as pointed
    editableGridControl
  2. On clicking the Nested grid view pencil, the next dialog box will let you select what entity you want the Nested Grid to be for. Note that this is with respect to the Contact entity and not the Account entity. For this example, I chose Opportunities.
    selectEntity.png
  3. On selecting the entity, I have to make sure my View is also correctly set to show the records
    selectView.png
  4. Now, my dataset will populate from the selected Entity and View. next we will need to select what should be bound as a key. Going back to the Nested grid parent ID pencil this time
    selectNestedGridView
  5. Select what should be the field to bind the data. In this case, I want to show the one that is related to the Contact expanded.
    parentControlIdSelection
  6. Now, click OK for everything and your configuration should look like below.
    Finally save and Publish all customization.
    finalConfig.png

Using Nested Editable Grid

Now, if you look at the Contact grid on the Account form. You’ll see an arrow on each record which indicates that it can be expanded.
collapsed.png
And when you click on it, you’ll see the Nested Grid for Opportunities we configured in the section above
expanded
And yes, Opportunity too is editable in-line!

Hope this helps!!

PSA v3 View Custom Controls used on Project form

Here’s a summary of what all Custom Controls are used in the out-of-the-box PSA v3 Project form. I strongly recommend not changing the existing controls/views.

However, if you accidentally delete any Tab/View, this post will help you get it back! 🙂

Project Task View

Project Task uses AdditionalColumns as the Default View from entity Project Tasks (Project)
projectTaskView

and the Control used is CC_ProjectTaskControl and note that the CC_TrackingView is CC_ProjectTaskControl_NotTracking, you’ll see a different CC_TrackingView used later below.
projectTaskControl

 

Resource Assignments View

Resource Assignment uses Active Estimates as the Default View from entity Project Tasks (Project)

resourceAssignmentView.png

And uses CC_ViewType as CC_EstimatesGridControl_AssignmentView
resourceAssignmentControl

Resource Reconciliation View

Resource Reconciliation View also uses the same Active Estimates View as in Resource Assignments
estimatesView

but uses CC_ReconciliationControl for the control
reconciliationControl

Estimates View

Again, Estimates View uses the same Estimates view as mentioned in the Reconciliation View and Resource Assignments View above.
estimatesView

Also, it uses the same CC_EstimatedGridControl but the CC_ViewType is CC_EstimatesGridControl_FinancialView
estimatesFinancialView

Tracking View

Tracking View uses the All Project Tasks as the Default View
trackingView

It uses the same CC_ProjectTaskControl as used in the Project Task view but CC_TrackingView here is CC_ProjectTaskControl_Tracking
TrackingControl

Expense Estimates View

Again, Expense Estimates View uses the same Estimates view as mentioned in the Reconciliation View, Resource Assignments View & Estimates view above.
estimatesView

But the CC_ViewType used is CC_EstimatesGridControl_ExpenseView
expenseViewControl.png

 

Hope this summarizes and helps you build your custom form quicker.

Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

One of the most common requirements is to upload images to SharePoint using PowerApps. From my learning from various sources, I’ll try to “demystify” my explanation to send/upload an image to SharePoint Document Library using Flows on my Canvas PowerApp.

Ingredients

Assuming you have the following things already  in place in PowerApps as well as in SharePoint

  1. PowerApps’ Camera/Image control and a Submit button. In my case, the image above is a camera so that I capture the image I want and the image below is the Image control to show me what I clicked.
    powerApp
  2. A SharePoint Document Library to record, say, Incidents.
    spDocLibrary
  3. We will get to the Submit button on the PowerApp once we create our Flow.

Flow

Let’s create a Flow to pick the Image from your PowerApp, convert it to binary and send it to the SharePoint Document Folder location called Incidents.

  1. Since we want to trigger the Flow from the PowerApps itself, we will select the trigger of the Flow as ‘From PowerApps’ and hit Create
    createFlow
  2. Once your Flow is ready, leave the first step of PowerApps because that’s the trigger. Add Step to create a SharePoint file and fill in the details of the Document Library you have created.
    createSPFile
  3. Fill in the FileContent as above. You’ll need this to be converted in the intermediate step after this.
  4. Now, you’ll need to add an additional step in between PowerApps and the Create SP File step as below. It will be a Compose action.
    addAction
  5. In Compose action, under Expression, select dataUriToBinary expression and make sure you open the bracket as well.
    dataUriToBinary
    toolTipHidden
  6. Now, go back to the Dynamic Content section and select the CreateFile_FileContent to complete the formula.
    fileContentAvailable
    completedFormula
  7. Click OK on the screenshot above and the formula should be set.
  8. Now, replace the File Content section to take in the Output of the Compose step.
    outputRecorded
  9. Save your Flow and your complete Flow should look like this.
    CompleteFlow
  10. I’m naming my Flow as ‘IncidentFlow’ so that I can identify it.
    incidentFlow

Adding the Flow to Submit button

Going back to the PowerApp, let’s Run this Flow on the selection of the Submit button and pass the image.

  1. Now, select the Submit button, and on the Formula bar, add the Flow you created, I named it IncidentRun. Select the same so that the Formula comes as IncidentRun.Run( for you to pass on the image.
    Now, pass the latest image on the collection i.e. the same image which is being displayed in the image control below.

    runFlowFormula

 

Running the App

I just ran the app on the desktop itself, you could do it from your phone too!
So I clicked on the Camera when I was ready, the image appeared in the image control and I that was what I wanted to upload. So I clicked on Submit button.
hittingSubmit

The flow was successful
FlowSuccessful

And my image was in SharePoint too!
imageUploaded

I know it is a lengthy post but I tried to summarize as much as possible. Make sure you have a way to uniquely name each file or else, the same file will be overridden.

Thank you!

 

Fix Ribbon icons on the Unified Interface in D365 CE

So, since adoption of Unified Interface is growing, people are asking – “What happened to the Ribbon icons?”. Well, a simple answer to this is tweaking the implementation a little.

Typically, you have custom icons on your classic Web UI that look like this –
classicIcon

But the same looks like a puzzle piece in the Unified Interface –
puzzlePiece

So, here’s what you need to do. Icons on the Unified Interface take SVG format. You’ll need to take you existing PNG Web Resources

 

Creating SVG Icons

Like most online services or applications, you can easily convert images to SVG. In this example, I’m using this online tool – https://www.online-convert.com/

Or you can try this too which I found quite a few people recommended – https://www.syncfusion.com/downloads/metrostudio

For this example, I used https://convertio.co/png-svg/ And I got my converted SVG document downloaded.
Now, create a new Web Resource in SVG and Upload the same.
svgWebResource

Ribbon Workbench

Once your Web Resource for the SVG format is set, going back to your Ribbon Workbench customization work space, go to the Button where you wan to update the icon and select the SVG Web Resource under Modern Image as shown below

modernImage

Publish Changes and See

Once your customization are published, you can simply refresh and check that your image has been updated

converted
Note: An online converted might not give you an accurate image. However, it is best recommended to create SVGs on an app. I’ve heard recommendations about https://www.syncfusion.com/downloads/metrostudio

Hope this helps!

Create your first PowerApp! Connect to SharePoint Online List

PowerPlatform is the next big thing in

PowerApps comes with several Dynamics 365 licenses and make sure you have been assigned one as well as below –
license

Navigate to https://web.powerapps.com/ to go to the Admin Center and here you can simply start working on your first app.

In this scenario, I want to be able to read from my SharePoint Online list and make decisions based on what data is in the List
spList

Build your PowerApp from data

  1. Among the options to create your app from either Canvas or Model-driven, I’ll chose to build one based on data which is a Canvas type of application.
    startFromData
  2. Now, I’ll chose SharePoint’s Phone layout since I want to connect to my SharePoint Online site to be able to read from my lists
    selectSPApp
  3. Now, since I already have selected SharePoint connector, I’ll be creating a new connection on the next page.
    createSPConnection
    Since this example is for SharePoint Online, I’ll select Connect directly (cloud services).
  4. Now, since I already had accessed the SharePoint Site, it appears in my list. You can either connect to a new Site from + New Connection button on the left-hand side or enter a new SharePoint Site in the URL and click GO. Or even select a recently visited one like I did –
    selectSPSiteFromRecent
  5. Then, choose your list
    chooseList
  6. And it takes a few moments to build out your App. And when it’s ready to be worked on, here’s what you get.
    appIsReady

Understanding your App Designer space

Won’t be covering much details on what each tool does, but wanted to share how things are placed –

  1. On the left-hand side, the App pages/components are divided into three main sections. (Obviously, you are free to add and modify more screens as needed)
    defaultTreeView
  2. You can add several controls on these screens
    insertTab
  3. And these controls/components can be adjusted from the right-hand side pane as below
    customizeProperties
  4. That’s basically the most of the App basics you need to know at this point. I’ll post more posts on that later. 🙂

Publishing Your App & Share

Presuming that your app is now ready to go, her’s what you can do in order to publish

  1. Navigate to File, give a suitable Name to your App.
    appName
  2. Move over to Save and Save your App.
    saveApp
  3. Once Saved, Share the App.
    shareThisApp
  4. Once you click on Share, you can get to Add users who will have access to this App and you can chose their permission level.
    shareWithUser
    permissionSelection

Running your first PowerApp

Assuming you have installed PowerApps on your device and logged in with your credentials, you’ll see the App as below

And you can start working on your App already

Hope this was quick. And then there’s a tremendous lot to be done with PowerApps and leveraging the PowerPlatform!

Discount Settings for D365 Sales Line Items – Line Items or Per Unit?

For Line Item entities Opportunity Products, Quotes Products, Order Products or Invoice Products, you can chose what type of Discount you want to give out.

This is a simple Organization-wise setting  that you’ll need to set to define how Discount should be given on the Line Item level.

System Setting

Navigate to System Settings and under Sales tab, find this setting
lineItemSetting

You can chose either between Line Item or Per Unit.
options

Discount Behavior

Line Item

Now, when the Discount method is set to Line Item, the Discount value will be given to each of the Line Item regardless of the Quantity
lineItemCalculations

In the above example, the Discount $50 is applied to the entire Line Item entry of 2 quantities of the commodity of the price $1200 is

2 x 1200 = $2400 – $50 = $2350 ($50 Discount given to the Extended Amount)

Per Unit

And in case of Per Unit, the Discount amount of $50 is given to each Quantity in the Line Item
perUnitCalculation

In the above example, the $50 Discount is given to the quantity of commodity of worth $1200 each. i.e.

2 x $1150 ($50 Discount given to each Price Per Unit amount) = $2300

Hence, it vital what setting you want to use while giving Discount to Line Items in D365 Sales

Hope this helps! 🙂

 

“Enable Mobile Offline” for D365 for Phones app in D365 v9.x

Finally! After much await and as April 2019 kicks in, the Mobile Offline capability for D365 Apps is finally setting in. But remember, this is in preview as of April 2019 and is not recommended for Production use.

Here’s you can enable Mobile Offline for any Dynamics 365 App

  1. You can see that you can now turn on Enable Mobile Offline for a certain app.
    beforeEnable
  2. Once you select it to tick, you’ll need to select a Mobile Offline Profile. Out-of-the-box, I have selected Sales Sample.
    selectedProfile
  3. These profiles are available for creation and edit in your Default Solution if you go and see
    profileInSolution
  4. And, they specify what properties should the offline mode have. Also, make sure the Users who should have this capability should be added to Users grid as shown below in the Offline Profiles.
    insideProfile
  5. Once done, save and Publish your Unified Interface app in the App Designer. Make sure the Profile is Published too!

Running Mobile Offline

When you open the Mobile App for that user, there’ll be a notification pop-up saying that changes on the org were made and you’ll need to update the same.

And when the update is complete, you’ll see the entities which are enabled for offline like the ones marked below (by a wifi signal icon)

 

So, let’s assume you are offline, you won’t be able to view records that are not enabled for Offline and will see the below error instead.

 

And the entities like Accounts, which is enabled for Offline, you’ll see the record as below

To summarize, that was the Offline for Mobile which is in preview as of April 2019. Hope this helps!

Import Time Entries in PSA from your Bookings in D365 PSA v3

Often, one of the real-life scenarios is making time entries by either remembering what you did the whole week or looking at the Schedule Board and based on what you were booked, making each Time Entry in PSA manually.

Tiresome and inefficient, right? Not any more, a cool feature let’s you just create Time Entries in PSA v3 by a single click.

Now, let’s say your Bookings look like the below. I’m booked on 2 projects across the week.

scheduleBoard

And now let’s see how we import these.

Import Time Entries

  1. Let’s see you want to make time entries now based on you Bookings in D365. On the Time Entries scree, drop down to the arrow besides Import.
    dropDown
  2. Select Resource Bookings. (Obviously, like this method – you can import from Resource Assignments and Outlook Sync too! But we will keep that for some other day)
    importFromBookings
  3. Then, you can select what all Time Entries should actually make it to the records. So you can select the ones you need and leave the rest.
    summaryOfImport
  4. Once you click on Import, it’s done! Time Entries are created.
    imported

Works like a breeze!

How to add Rating Values to Rating Models in D365 Field Service and PSA

Rating Models and Rating Values are attributed to Bookable Resources in Dynamics 365 PSA and Field Service. Out-of-the-box, there are 3 Rating Values – Familiar, Good & Proficient. But obviously, you want to customize to have your own.

This is a tricky change and this post will exactly describe before you end up doing something wrong.

If you think all you need to do is add a Rating Value to the Rating Model and save, it won’t work

addRating

Because when you do this, the Value field is locked and you can’t enter anything and just saving the record with the name of the Rating Value will result in the error as shown below

errorWhenDirect

Update Max Rating on Rating Model

So, the right way to do it is to update the Max Rating Value on the Rating Model record.

updateMaxRating

As soon as I save the record, see the an additional Rating Value appears. And in fact, these are the new records that were created when you updated the Max Rating Value and not that the old ones were renamed to ‘Enter rating label here…’

newLabelsToEnter

Note: You can simply enter the record and update all the Ratings inside to the corresponding values.

What happens to existing Ratings used for Resources?

They are all there but have been deactivated, if you query all the Rating Values as is, you’ll see the ones created due to the change we did above and the ones that already existed were suffixed with “[Inactive]” label. See below –

newlyCreated

Well, since these are all the new records created, the old ones are ‘Deactivated‘. What remains with the existing Bookable Resource Characteristics records are the Inactive ones.

inactiveAssigned

To update these, you can do a simple Advanced Find by querying one of the inactive Rating Values and updating them using Bulk Edit to set the new one.

  1. Query the inactive ones
    queryInactive
  2. And simply Bulk Edit to update the Inactive ones
    bulkEditInactive

By the way, if you want to Bulk Clear and start fresh, you can check my blog on Bulk Clearing fields using Advanced Find here – D365 Quick Tip: Bulk Clear field values

Hope this helps you!

 

D365 PSA: Restrict Project access only to their Project Managers

Out-of-the-box PSA’s Project Manager security role provides complete access to even other Project Managers. But then, what if you want to bring down the access of the Project Managers to their own Projects only?

Remember, access in D365 PSA is provided for Owner (ownerid) field and not Project Manager (msdyn_projectmanager) field.

PSARoleRestrict

Scenario

Now, I don’t want a Project Manager to have access to others Projects and looks like this can’t be controlled from the Security Level perspective, given the Project Manager is a separate field than Owner of the Project.

So, I’ll limit the access to only the User level (the one who created the record would have the access, obviously)

PSARoleRestrict2

But this remove the access from even the Project Managers since they don’t own the Projects. To overcome this, I’ve written a simple plugin to provide access to the Project Manager whenever they are updated by Sharing and giving PMs the access.

For this, I’ve written a plugin code that will grant all permissions to the Project Manager of that Project and I would like to share this with you all to consume it.

GitHub Project

Here’s the GitHub repository I’ve created which has the plugin code and the Unmanaged Solution that contains only the plugin assembly and the registered step –

Link: D365PSA-PMAccessRights

gitProj

The D365 Unmanaged Solution resides here –

unmanagedSoln

This will work in the following scenarios –

  1. When a Project Manager is changed from Person A to Person B, the access rights of Person A will be removed and granted to Person B.
  2. You can even create a trigger field and use an on-demand workflow to set the trigger. This trigger should be included in the filtering attributes of the plugin step to update the existing records.

This will provide access to the Project Manager of the Project automatically apart from the Owner so that they see/access only Projects that concern them
accessGiven

Make sure no other security role is overriding your restricted access.

Hope this helps! 🙂

Opt-in for April 2019 Preview Updates

Finally, as scheduled on 1st Feb 2019, April 2019 Preview Updates can now be opted in for your organization.

Opting-in is available for Sandbox, Trail and Production environments.

Opt-In

  1. You can now go to https://admin.powerplatform.microsoft.com/ and look for the Organization on the left hand pane
    pPlatformEnv
  2. Select your Organization, look for Updates section on the bottom or right hand side
    manageOrgs
    Zoomed In
    zoomedManage

  3. Click on Activate now. Be careful, these changes can’t be undone.
    activateNow
  4. Enter your Org name and click Continue
    orgName
  5. And it will take some time to activate
    activating

 

And once you are set, you’ll see that the April 2019 update was applied –

aprilApplied

 

Happy D365’ing!

Linear Slider Custom Control in D365 v9.x UCI

Using Custom Controls is the new cool in Dynamics 365. Specifically, if visual cue of approximation or ‘to what extent’ is priority over the textual/numeric data, using Custom Control is the best way forward.

Something like this –

featured

Use Case

In my use case, I want to know the client budget so that I keep Quotes for them around the range they can afford.

Now, number will give me an idea. But a visual cue of the same will let me know the spending capacity of the client in the bigger picture.

So, I’ll use Linear Slider custom control on the Client Budget currency field to show a slider as well as the currency value.

Enabling Linear Slider on Currency Field

  1. So here, Client Budget (new_clientbudget) is my Currency type of field in D365.
  2. On the Form Editor, I’ll go to Properties of the field and go to Controls. Click on Add Control…
    addcontrol

  3. Select Linear Slider among others and click Add.
    addslider
  4. Then, I’ll set the properties of the control. Make sure you enable them for Web, Phone and Tablet as per your preferences.
    sliderproperties
  5. I’ve set the min and max range for the control, also that step which should reflect while moving the slider.
  6. Finally, click OK and publish changes.

 

Linear Slider

featured

You can even input custom number in the box and the slider will set to it.

manualnumber

 

Hope this was useful! 🙂

Thanks for reading.

Use Azure App Passwords for MFA enabled D365 authentication from Console App

If you have a Console App that authenticates to D365 using a credential (typically, an Administrator) but now the administrator is setup for Multi-Factor authentication, your Console App won’t work. So here’s what you can do.

If you first want to check out about enabling Multi-Factor Authentication, you can check my blog post on it here – Office 365 Admin: Quickly Enable Multi-factor authentication for users

Standard Authentication vs MFA enabled User

When there’s not MFA enabled for Dynamics 365 (Office 365) account credentials, you are able to connect to the organization with no issues and get the CRMServiceClient in your application easy.
authenticated

But, if you have Multi-Factor Authentication enabled for a credential that is used in Console Apps to connect to D365, the Console App will not connect and the CrmCerviceClient will have null as below with the error ‘Unable to Login to Dynamics CRM

unabletologin

Managing App Passwords on Azure Portal

Once you have multi-factor authentication enabled for your account, you can go to portal.azure.com and manage App Passwords as follows –

  1. In Azure Portal, go to your account settings.
    gotoaccount
  2. Then, go to Additional security verification
    additionalsecurityverification
  3. Look for App Passwords
    apppasswords
  4. You can manage and create more passwords here
    manageapppasswords
  5. Create a password if you don’t want to use a default one or want to use different passwords for different apps. Give it a suitable name and click Next
    createapppassword
  6. Copy the password as it is the only time it will be displayed.
    copypassowrd
  7. And you can see your passwords as you create them
    morepasswords

 

Implementing App Passwords in Console App

As the name suggests, App Passwords will let you create special passwords for applications to authenticate to Dynamics 365 without needing to go through multi-factor authentication like when you’re running a Console App to connect to Dynamics 365

  1. Go to the Password in the credentials in the App.Config of the Console Application
    oldpassword
  2. And replace it with the App Password
    newpassword
  3. Now, Build the application and run it. It will authenticate successfully.
    authenticated

Hope this helps! 🙂

 

Restrict User Access to a D365 instance using Security Groups

Use Case

You have multiple instances and you don’t want every member with a D365 license to be able to access each of those environments. How do you tackle this? Answer is using Security Groups on the Environments and Users.

Creating Security Group

In Office 365, create a Security Group and add members to it who should have access to the desired environment.

  1. Navigate to Groups in Office 365 and create a New Group. Give it a suitable name.
    creategroup
    groupname
  2. Add members to the Group who should have access. Click on Edit as shown below to Add members to the group and select the members and save it.
    editmembers
    addmembers
    membersadded
  3. Your Security Group is ready.
    securitygroupready

Apply Security Group to the D365 instance

  1. Navigate to Dynamics 365 Admin Center and select Edit on the instance you want to apply the Security Group on.
    editinstance
  2. Select the Security Group field and select the Security Group you created.
    selectsecuritygroup
  3. Click Next.
    clicknext
  4. Save once confirmed that you have selected the correct Security Group.
    saveinstance
    That’s it.

Who all can access the environment

All those are a part of the Security Group applied to the instance will have access to the environment including the Global Administrator
enabledusers

Rest of the users will be in the Disabled Users list
disabledusers

And if they try to access the environment, they will not be able to and will see this –
accessdenied

Hope that was easy! 🙂

Using ‘Clone a Patch’ & ‘Clone Solution’ in Dynamics 365 Solutions

Doing incremental deployments from Sandbox to Production is a part of every other D365 implementation.

And when do this, typically, you just create a new solution for every single time you move things over. This creates a lot of mess and leaves your Solutions in unorganized dump!

Let’s see how we can stay organized by using Clone a Patch and Clone Solution to keep things synced and clean

Clone a Patch

Clone a Patch should be used when you don’t want parent dependencies in the solution all over again unless you want to change them. So, always use this when you want to add newer things to a previously existing solution.

  1. I have created MainSolution_1 as my main solution, the first time I started my customization. I added only 1 field, called Target Sale for demonstration purpose.
    mainsolution
  2. Now, let’s say I deployed it over, the next time I want to add some more functionality to the existing solution I deployed, I should not create another solution.
  3. Rather, I’ll use Clone a Patch as shown below.
    cloneapatch
  4. In Clone a Patch, I’ll keep the Display name same and the version number is configurable up to the last 2 sub-versions.
    clonepatchproperties
  5. So this is how my Patched solution will look.
    preparedclone
  6. In this solution, I’ll add another field called as Min Target To Achieve and deploy it over to Production, maybe.
    patchcontents

Clone Solution

Clone a Solution is used when you have a main solution and several patches. Clone a Solution will roll up everything into a new “parent” solution and remove every other solution of which you cloned including the source solution.

  1. I’m select MainSolution_1, the first main solution I had created with the field Target Sale field. And then I chose to Clone Solution.
    clonesolution
  2. Similar to Clone a Patch, I have now the version control over the first 2 version numbers and since it is the first Clone, the final numbers are 0.0. I named it MainSolution_1_Cloned.
    clonesolutionproperties
  3. It takes a few moments to Clone everything.
    inprogress
  4. Now, I have cloned the solution and the resultant solution has all the components from the Main Solution as well as from the Patch solution summed into 1 final solution.
    cloned
  5. Also, notice that all the other solutions including the MainSolution_1 from which I cloned this solution is deleted.
    cleanedsolutionsarea

Thereby, you have a clean Solutions area with all sorted work.
Hope this helps. 😊

D365 Quick Tip: Delete Records Imported by mistake

One of the most common blunders often made in Data Import are importing whole lot of records without finalizing.

And when you import, you realize you needed to add something more to the Import or some things were pending in the Excel file and you ended up uploading them all!

Delete Imported Records

  1. Assuming your Import was successful and you want to now just revert what all was imported, navigate to Settings > Data Management > Imports.
    importjob
  2. Open the Import job and look for the option under Delete which says ‘All Records Imported to This Entity During This Import
    mainaction
    There, quite self explanatory.
  3. Once you click on it, a Delete Job is triggered once you fill in the below information
    deletejobset
    Important: When I select ‘In addition to deleting imported records, also delete import job history’, it will also delete the Import Job I started in Step #1. If you still want to keep it, you can according to your personal preference.
  4. Now, when you go to Settings > Data Management > Bulk Record Deletion, find the Import you started in the step above.
    deletedrecords
    Note that there are 4 records deleted here though I imported 3 records. The additional record is of the Import Job deleted while setting up the Deletion job in step#3 above.

Hope this quick tip helps! 🙂

 

Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks

After 2 posts to trying to summarize Learning Paths, here we are to Guided Tasks which conclude this series. We will see D365’s early adopters can get acquainted with processes in your organization and getting them to know the system.

To check the other 2 posts – Please follow the below posts

  1. Setup – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup
  2. Sidebar –Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Configuring Guided Tasks

  1. Assuming you are already in Learning Path > Content Library. Select Guided Task.
    guidedTask
  2. Fill out the properties of the Guided Task like the name and how you want it to behave.
    guidedTaskProperties
  3. One you save, you get a Flow Editor where you can add 4 different types of Guided Task modal.
    flowEditor
  4. So, these 4 types of modals are available. Here’s what each of them do –
    1. Step with Next Button – Simple instruction in Text or Video and a Next Button
    2. Step with User action – Will make you click the button/action it is pinned to. And only then move forward.
    3. User Action with Next Button – This is a combination of A and B above. You can either select the action or skip to next step.
    4. Learning Step – It is like a tip and comes with a Button that can open another Learning Path Published item. Like, Sidebar in my case.
      stepTypes
  5. When you drag either of the above onto the screen, the D365 screen is highlighted with areas where you can drop it and it gets pinned to that item.
    skeleton
  6. On each of the types of modals, you get to either enter Text or add a Video.
    contentTypes
  7. For Learning Step modal, you get to also configure what will open when user clicks Learn More.
    learnMoreEditor
  8. In my case, I’ve opened the existing Sidebar from Part 2 of the blog series.
    sideBar

Finally, my track looks like this –

track

Previewing and Publishing

  1. Once you are done editing, Save your changes and Check In your changes.
    confirmCheckin
  2. Once you proceed, you’ll be asked in the same way as Sidebar to specify which all environments you want to publish this to.
    envSelect
  3. On publishing, you’ll see this notification.
    published

Seeing Guided Tasks Work

    1. Step with Next Button.
      stepWithNextButton
    2. Step with User Action (Notice that it doesn’t have a Next button but is asking you to click on the Gear Icon)
      userAction
    3. User Action with Next button, either of which will take you to the next step.
      nextUserButton
    4. Learning Step (Clicking on Learn More will open the Sidebar on the right hand side)
      learningStep
    5. Sidebar showed up on clicking Learn More from Step 4 above.
      LearnMoreSidebar

Hereby, I conclude Learning Task. I tried to keep it as short as possible. But then, lots of screenshots.

To summarize, you can read previous blogs in this series
1. Setup – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup
2. Sidebar – Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Hope this gets you through Learning Path quickly! 🙂

 

Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Sidebar is a component in Learning Path where you can design a Sidebar that appears like a tray popping from the right side of the screen. You can have quick help items in it so that new users to D365 can use it to get help on the most frequently requested items in your Organization.

Before you begin, you can check my post i.e. Part 1 post of this series on setting up Learning Path in D365 – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup

Also, check out Guided Tasks in this blog post – Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks

In my last, I setup Learning Path in D365 Org, let’s take a look at designing one of the aspects of Learning Path i.e. Sidebar

Creating a Sidebar in Learning Path

  1. Assuming you have gone through the setup of Learning Path and you are now navigated in your Org to Training > Content Library. Content Library is open and you need to select Sidebar
    createSidebar
  2. On opening the same, you’ll be asked to set preferences of what should the details of the Sidebar be
    sidebarProp
  3. On clicking Save, a designer pane will open on the right hand side of the Page like so
    editorOpened

Designing your Sidebar

Now, let’s put a few items on the Sidebar and publish it to see how it looks

  1. I’ve given a suitable Title to my sidebar, I’ll call it CFT117 Helpdesk for now. Then, when I want to first item, I’ll click on Section #1 below that and a Pencil and Delete icon will appear. I will select the Pencil Icon to start editing my first section
    editingSection1
  2. On clicking the Pencil, a menu to show what all I can add appears, for example, I select List of Links (I will just give link to a website here)
    selectContent1
  3. Once I select List of Links, editor to add Links will appear. I’ve given a title to it called as Visit Company Website and I’ll select + Add Link as shown below
    addLink
  4. After clicking on Add Link as in #3 above, I get options to specify what the link will do. For example, I’ll select Webpage since I want to redirect to the company website
    defineLink
    linkDetails
  5. After I click Next, the first Link will be set and will appear like this.
    linkSet
  6. Next, I’ll select to add a Video (you can select what you want to show in subsequent sections as mentioned in step #2 above).
    So, I’ve given a title ‘Using PSA’ and entered the URL of the video I wanted to show. Finally, my section will look like this
    videoProperties
  7. After everything is done, I’ll click on Save
    saveSidebar

Publishing Changes

  1. Next, on the button left, you can select Preview.
    preview
  2. Once someone clicks help, this is how the pane will look. Finally, if you’ve decided to publish it, you can click on Publish button on the bottom left
    previewShown
  3. And you can select which all Orgs you want to publish this Sidebar to –
    publishControls
  4. On confirmation, it will tell you that the content has been published successfully.
    published

Using Sidebar

Now, our Sidebar is ready. And once the user clicks on the Help Icon on the top right as shown below –
clickHelp

They’ll see the Sidebar as you designed
sidebarDisplayed

 

Excuse me for the unusually lengthy post. Hope this helps! Learning Path – Part 3 – Guided Tasks has been published too – Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks!

Use Learning Path for your D365 v9.x Organization – Part 1 | Setup

Learning Path an intuitive feature as compared to Customized Help. Customized Help will take you to an entirely different section whereas Learning Path will guide you through the application when you use the system. This is a multi-part b