Allow users to create App Passwords in Office 365 | Multi-factor Authentication

If you are an Admin User who wish to create App Passwords so that you can use them in your code/web applications so that you don’t have to store credentials in your application? Example: Azure Function you are developing shouldn’t store the password of the User.

At times, you must’ve noticed that why you can’t create App Passwords even when you are having MFA enabled for yourself!

Here’s why –

Scenario

Let’s say the users are logged in and they go to their Office 365 Account where they can add multiple Authentication Methods. Shortcut for that is https://mysignins.microsoft.com/security-info

  1. Once they are in Security Info in order to add new method of Authentication as below

  2. And they don’t get to create an App Password by default.


    Let’s enable users to be able to create their own App Passwords from Azure Portal.

Enforce Users to use MFA

Let’s say the Conditional Access above is already set. Now, you need to enforce users to use MFA.

  1. In O365, go to the User in Active User whom you want to allow creation of Azure App Passwords.

    Select the user and click on Multi-factor Authentication.

  2. Now, in the multi-factor authentication page, you’ll see the users as whether they are using MFA or not.
    As you see below, CRM Admin is Enabled for Multi-Factor Authentication, but not Enforced.

    So, you have to click on Enfore button to enforce the MFA.



  3. Now, when you click on Eforce, you’ll see the below message


  4. After enforcing, you’ll get a success message as below.


  5. Once enforced, you’ll see the below status is updated on whoever this is enforced on.




Create App Passwords from My Sign-ins page

Now that we have enforced the User to use MFA, here’s how you can create App Passwords

  1. As shown in the beginning, try to Add a new method


  2. This time, you’ll be able to see App Passwords as an option to select. Select it and click on Add




  3. Next, you can give a name to the App Password you are setting. You can give it a suitable name keeping in mind the purpose of the App Password you are creating.



    I’ll just give a sample name here since I want to use it in Azure Functions which I’m working on.


  4. And once it is created in a few moments, make sure you copy it before clicking on Done. Else, you can’t retrieve this later and it will be created without you noting it down.


  5. And it’ll be listed among other authentication methods

Additionally, it is recommended to also review setting up Conditional Access policies too while setting up Azure AD Multi-Factor Authentication – https://docs.microsoft.com/en-us/azure/active-directory/authentication/tutorial-enable-azure-mfa?WT.mc_id=DX-MVP-5003911

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

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

Thank you!!

Use Hierarchy in Roll Up Fields in Dynamics 365 CRM

Here is the use of Use Hierarchy in Dynamics 365 CRM Roll-up Field’s Use Hierarchy option when defining the logic of the Roll-up fields.

Scenario

Let’s consider this out-of-the-box scenario where an Opportunity Rolls up Est. Revenue to the Account it is tagged to. Also, that Account also has another Account set in the Parent Account field.

So, the hierarchy here is Account (Parent Account) -> Account (child Account) -> Opportunity

Now, our demonstration of Use Hierarchy will show where does the Open Revenue (field on the Account) should Roll up from it’s own Account or from the Opportunity of the child Account’s Opportunity as well.
You’ll see a Hierarchy Icon to all records that participate –


And when you select either of them, you’ll be able to click on View Hierarchy button on the view’s Ribbon


This will show you how the Accounts are arranged in hierarchy


And here’s where you can access your Hierarchy Settings

Let’s see!

Use Hierarchy in Roll Up fields

Here’s how you would see the option to switch between Use Hierarchy in the Roll Up fields in Dynamics 365 –

Use Hierarchy: YES

Now, assuming this is set to Yes and it selects the OOB relationship that defined this hierarchy

  1. Consider the child Account “Alpine Contoso” (This is a child account of “Alpine Ski House Main“)


  2. And this Account Alpine Contoso has it’s own Opportunity worth of $25K


  3. Now, let’s look at the Alpine Ski House Main‘s Opportunity which is worth $30K

  4. Now, the Open Revenue for this child Account “Alpine Contoso” is $25

  5. However, since we are using Hierarchy as YES and selected the relationship between the self-lookup of Account itself, this value will also add up to the Open Revenue of the parent Account “Alpine Ski House Main” is $30K + $25K = $55K


    Here, we saw that the Open Revenue from the child Account too Rolled up to the Parent Account.

Use Hierarchy: NO

Assuming, the Roll-up field is now set to NO to Use Hierarchy, let’s see the difference on the Parent Account “Alpine Ski House Main” itself.

  1. If we look at the Alpine Ski House Main‘s Open Revenue value, it’ll only have $30K


  2. This $30K belongs to it’s own child Opportunity and not child Account i.e. Alpine Contoso‘s Opportunity.

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

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

Thank you!!

Co-presence in Power Automate | Multiple users working on a Flow

Here’s a cool feature that is just announced!

Now see who’s also Editing the Flow in parallel with you. Microsoft just announced this update is super-useful in teams working parallelly on a Flow – https://powerautomate.microsoft.com/en-us/blog/announcing-co-presence-in-power-automate/

Here’s a quick summary

Co-presence in Flow

Once a Flow is shared and if both the users happen to be on the same Flow in Edit mode at the same time, here’s how you identify

  1. Let’s say this Flow is being edited by CRM Admin and it’s shared with the user Priyesh Wagh too.
    And it appears like a usual Flow which you are editing


  2. Now, on the other hand, Priyesh Wagh also logged in and opened this Flow to Edit. And when CRM Admin too is already editing parallelly, both parties will see the other participants like so –




  3. Both parties can continue to Edit. However, when either of them saves First after both have entered, there will be no issue.
    Now, once any other party after that Saves their change i.e. 2nd save by other user than who first saved, they’ll see the below warning asking to choose an option to avoid the clash.


  4. Let’s say the user chooses to Save a copy, you’ll be asked to save this into a new Flow.



    The new Flow saved will not be shared with other users and hence, will continue to exist outside of the Shared with me section into Cloud flows section



Hope this was useful

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

  1. Retrieve Metadata of Global OptionSets from Dynamics 365 in Power Automate | HTTP with Azure AD action
  2. Primary Key of Activity type entity in a Dataverse connector in Power Automate | Quick Tip
  3. Split On in Power Automate in SharePoint trigger for Item updates
  4. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  5. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  6. Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate
  7. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  8. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  9. Asynchronous HTTP Response from a Flow | Power Automate
  10. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip

Thank you!

Create Teams Meeting invite from Power Automate

Here’s an example of several use cases which can let you create a Teams meeting from within Power Automate based on your business use case.

In my example, I’m using Power Automate to schedule a meeting from a Project in Project Operations inviting all Team Members for a follow up!

PS: Creating an Appointment in Outlook doesn’t set the Teams call. 😊

Scenario

For example, in Project Operations’ sample Project example – I want to simply put a Teams meeting to all the Project Team members of this sample Star Piping Project.

  1. Here are my Project Team Members whom I want to send the Teams invite to.


  2. And I should just be able to run a Flow from the Project itself to send an invite to all the Team Members.
    I’m calling my Flow as ‘Teams Roundtable Meeting’

  3. And my Flow is asking me when this meeting should be. So, I’ll mention the same.
    So, I want the meeting to be on 16th Sep 2021 and start at 10:30am


    And End it by 11:30am


  4. And once the values are accepted, the Meeting should be on the Teams of all the Team Members





    Let’s see how I built this Flow.

The Flow

Now, this is subjective – in your case, this could be anything we can imagine!!

  1. I’m accepting the important parameters in the form of Dataverse (Legacy) connector [Because, this connector let’s you Run the Flow in the context of the record, the new Dataverse green connector doesn’t allow this.]

    These are the values which we filled when we ran the Flow on the Project.


  2. Further, I have some steps to retrieve the Team Members, then eventually their Email addresses (In Project Operations, you need to retrieve the Email addresses from the Bookable Resources and further – see if User record has these email addresses or not)
    Next, I’ll create a variable of type Array to collect the Email Addresses which the meeting invite should go to.

  3. Now, I’ll append all the Email Addresses I retrieved from the Team Members in the array.

  4. Now, the Array is formed with all the Email addresses separated by commas. But, we are not done yet. We need to form a string.


    So, I use Join operation to join the email addresses into a string separated by semicolon (just like how you enter in the To field of emails)


    The result will be a string of Email addresses separated by semicolon


    Finally, once all the important data is collected, we can proceed towards creating the Teams invite.

Create a Teams meeting

Here’s how you can create a Teams meeting from Microsoft Teams connector in Power Automate

  1. Look for Microsoft Teams in Power Automate

  2. Now, in this Meeting, I can set the parameters based on how I want the meeting to be created.
    I’ll fill in the information which is required for the Invite to be created.
    The Start Time and End Time need to be set in the date-no-TZ format, hence, I’ve arranged the same accordingly
    Select Calendar Id as Calendar (Other options are Birthdays and United States Holidays)

  3. The Outputs are from the result of the Join operation we performed to form the string of Email addresses to be added as attendees.

  4. Finally, you can select these optional parameters to make sure the invite is created based on your preference.

    And that’s it!

Teams Invite vs Calendar Invite

Now, if you have a normal Calendar Appointment, it’ll look like below – It doesn’t have a Join button


Whereas, the Teams Calendar Invite has a Join button on it

Caveats

Some caveats worth mentioning –

  1. In case you are planning to have Appointments created in D365 and eventually either sync it to Outlook using Server-Side Sync, the invite will not be a Teams Invite.
  2. No option to later retrieve this Outlook Appointment in Flow and convert/update it to a Teams call.

Hope this was useful!

  1. Action.ShowCard vs Action.ToggleVisibility in Adaptive Cards | Microsoft Teams
  2. Admin Center URLs under M365 – Power Platform, Teams, SharePoint, Power BI
  3. Tag a User in a Microsoft Teams post made using Power Automate
  4. Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
  5. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  6. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  7. Turn Teams On / Off at Org Level, provisioning users | M365 Admin Center Tip
  8. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists

Thank you!

Recommendation in Business Rules in Dynamics 365

Here’s a super-useful feature to describe a field in case the user is not sure if they should manipulate the field in any way or not.

In Dynamics 365 Business Rules, here’s how you can add Recommendations based on the condition selected in the Business Rules.

Scenario

Here’s the scenario we will use to demonstrate Recommendation –

  1. If my custom field called as “Context” on the Contact entity says – Customer, then, recommend the User to enter a US phone number in Business Phone field.
  2. Also, if the user choses to Apply the Recommendation, the Preferred Method of Contact will also be set to Phone.

Add Recommendation

Here’s how you can add a Recommendation post you condition in a Business Rule.

  1. In Business Rules, let’s say you will first set the condition.
    Here, I’m setting the value to check is Context = Customer


  2. If the Context field is set to Customer, then, show a recommendation. Here’s how you add a Recommendation


  3. Once you add a recommendation, you can set as to what it should point the recommendation to – In my case, I’m pointing to a Business Phone field.
    Now, the field I chose is Business Phone
    The Recommendation Title is the one that will be shown in bold when Recommendation bulb is clicked.
    The Recommendation Details will describe the Recommendation itself.
    Post this, expand the Details to add the Action to take under the Recommendation


  4. Once you apply the Recommendation Properties, it is also mandatory to add an Action – Else, the Business Rule won’t be enabled.
    In action, I want to set the value Email in the field Preferred Method of Contact.


    And the properties on the right hand side are –
    Preferred Method of Contact field to set to Phone


  5. Once all the changes are applied, you can simply Activate the Business Rule and test the same.

Working

Here’s an example –

  1. On Contact, notice the Business Phone field appears like a normal field.
    Notice the Context field says Marketing Only for now, I’ll update this in the next step.


  2. Now, I’ll select Customer

  3. When I do this, a Bulb appears next to Business Phone, click on it.


    When I click on it – The area will show the recommendation with the Title and the Recommendation I entered in the Business Rule step
    [Notice that the Preferred Method of Contact still says ‘Any’]. This will be changed when I click Apply.


  4. And when I click Apply, the Preferred Method of Contact will be set to Phone.


    Hope this was useful!

Here are some more posts on Dynamics 365 which you might want to check –

  1. Retrieve Metadata of Global OptionSets from Dynamics 365 in Power Automate | HTTP with Azure AD action
  2. Single record and multiple record auditing in Dynamics 365 to Audit record access | M365 Compliance
  3. Enable Plug-in Profiler in Settings area in SiteMap in Dynamics 365 | [Quick Tip]
  4. Disable Recent Records from Dynamics 365 Lookup Control | Model-Driven Apps [Quick Tip]
  5. Language format for Whole Number field in Dynamics 365 CE
  6. Custom Help Pages and Guided Tasks for Unified Interface in Dynamics 365
  7. Make Managed fields Required in Dynamics 365 – Managed Properties Error [Workaround] | D365 CE Quick Tip
  8. Sign up for a Dynamics 365 Project Operations (Lite Deployment) environment and provision a new instance | Power Platform
  9. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
  10. New App Designer for Model-Driven Apps | Power Platform

Thank you!

Retrieve Metadata of Global OptionSets from Dynamics 365 in Power Automate | HTTP with Azure AD action

Not sure if you’ll ever need to retrieve the Metadata of Global OptionSets ever or if you’re just curious that this could be retrieved or not, probably this post might be able to help. 😊

Let’s look at how you can retrieve Global Option Set metadata from your Dynamics 365 instance in Power Automate using Invoke and HTTP Request using Azure AD connector.
I’ve mentioned some considerations along the way as well!

Flow

Let’s see how we can retrieve the Global Option Sets from your D365 instance –

  1. For simplicity, my Flow will run on-demand. Hence, the next step is to have HTTP with Azure AD connector to be used.
    Consideration: The reason we are not using Dataverse connector is because it doesn’t let you Retrieve / Retrieve Multiple on GlobalOptionSetDefinitions which is required in this case.
    And you’ll be using HTTP Request to retrieve resources from your current D365 environment and hence, will use Connection Reference based on who can access the APIs.



  2. Now, in the Invoke HTTP Request with Azure AD, use the below to query the GlobalOptionSetDefinitions


  3. Further, once this is executed, the Output of the request will be a JSON response which is tremendously huge and detailed.
    So, when I format it in an online formatter, it looks something like this –


  4. Consideration: $filter= is not supported in this type Request. Hence, it won’t work and you’ll get the below error. Below is an example when I tried –




  5. So, after referring to #3 above
    Now, once you have retrieved this data, we’ll use Filter array action in Power Automate to filter the OptionSet Metadata based on the the Name of the OptionSet and select that piece of JSON which contains the details of 1 single Option Set

  6. Now, in Select, we’ll select the Value part of the Body of the HTTP Request we’ve used above.
    body(‘Invoke_an_HTTP_request’)?[‘value’]
    And the reason we select value is because from the Body of the step above, we are selecting the Value array which is an Option Set record itself.
    Further, we’ll use a criteria to Filter the same.


    And if you Peek Code this and see


  7. Next, the criteria we’ll use to filter is based on the name of the Option Set itself which you can easily see in Dynamics 365.
    We’ll pick item()[‘Name’] to select the JSON attribute whose value we want to compare on the right hand side


    And if you Peek Code here

  8. Now, the reason we chose this is in #3 above, if you expand, you’ll see the Name JSON attribute that contains your Unique Name of the OptionSet.


  9. And now, when you Run the Flow and see the Result of the last Filter Array Step


    And if you take these Outputs and Beautify to see the structure, you’ll see that this is 1 Option Set’s Metadata. You can then see these values if you ever need to retrieve the Global Option Sets at any point.

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

  1. Primary Key of Activity type entity in a Dataverse connector in Power Automate | Quick Tip
  2. Split On in Power Automate in SharePoint trigger for Item updates
  3. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  4. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  5. Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate
  6. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  7. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  8. Asynchronous HTTP Response from a Flow | Power Automate
  9. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  10. FormatDateTime function in a Flow | Power Automate

Thank you!

Performance Insights for Model-Driven Apps | [Preview]

One of the important aspects of ‘User Adoption’ is also ensure that the Model-Driven App you’ve designed for your Org’s Users stays optimized and ensures the users get the best of it.

Let’s see how we can utilize Performance Insights to help us optimize our Model-Driven App!

Performance (Preview)

Performance Insights is in Preview and here’s how you can access the same.

  1. Go to https://make.powerapps.com/

  2. Now, in your Apps below, select the Model-Driven App you want to view Performance metrics of.


  3. Now, once you open, you’ll see the metrics as below


    Let’s understand how you can read these metrics and take actionable actions on the same.


Understanding the Insights

These insights are categorized based on severity. Let’s see which needs your attention the most –

  1. The Insights can be narrowed based on the timeframe of 24 hours, Unfortunately, I have only 1 Date to show in my case.


  2. I recommend paying special attention to the ones with Warning on them


  3. Now, looking at the first one for example is PluginTraceLog which I left ON while I was working on Plugins on this environment in the App.
    So, if I select the first one


    The right hand pane will detail out what the issue is and what Area to focus on.



  4. Also, if you look at the How to improve part, it’ll point you to the Microsoft Docs for the suggested workaround/action.


    It’ll take you to the Microsoft Docs section of the particular issue in question –


  5. In case you have a new environment and didn’t work inside the App significantly for a particular time frame, you’ll see this message.



    Here’s the complete Microsoft Docs article on the detailed Performance Insights for Model-Driven Apps –
    https://docs.microsoft.com/en-us/powerapps/maker/common/performance-insights-overview?WT.mc_id=DX-MVP-5003911

Here are some more Model-Driven and Canvas Power Apps posts you might want to check out –

  1. HTML Text control in Canvas Power Apps | Power Platform
  2. Disable Recent Records from Dynamics 365 Lookup Control | Model-Driven Apps [Quick Tip]
  3. Advanced Lookup in Model-Driven Apps | Power Platform
  4. New App Designer for Model-Driven Apps | Power Platform
  5. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  6. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
  7. How to add Rating Values to Rating Models in D365 Field Service and PSA
  8. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  9. Transition effect on Gallery Items when hovered over in a Canvas Power App | [Quick Tip]
  10. Retrieve Hashtags from Text in a Canvas Power App | Power Platform

Thank you!

Single record and multiple record auditing in Dynamics 365 to Audit record access | M365 Compliance

One of the most important asks for organizations who are sensitive about tracking their data is – Which records are accessed by the user?
There’s a powerful tool in Compliance Center i.e. Audit that can record this as to when a certain D365 record was accessed and all the details about the same.

What is recorded?

Single record – Only access to Dynamics 365 record opening will be audited/captured.

Multiple record – Access to Dynamics 365 record as well as other controls that were in context of the record like sub-grid controls, timeline controls etc. will be audited/captured.

Pre-requisites

  1. The User whose D365 Record Opening activities are to be logged must either have a O365 / M365 Enterprise E3 / E5 License assigned to them.

  2. The environment should be a Production one.


Turn on Recording of Audit (Dynamics 365 & M365 Compliance Center)

Now, to be able to record Auditing of User Record Access, you’ll need to make sure the Auditing is turned ON at these places –

  1. In Dynamics 365, make sure the Auditing is turned ON at the Global Level and that Audit Read Access is enabled too.


  2. Next, make sure the entity’s whose record access you want to capture should have their Auditing as well as Single and/or Multiple Record Access Auditing turned ON as well.


  3. Now, the M365 Admin Center (https://compliance.microsoft.com/) should also be enabled for recording the Audit of User access. This will start recording User and Admin Activity.


    It’ll ask for confirmation and then start updating. In my experience, this failed a few times and I wasn’t able to know for sure when it actually got enabled.


    Then, it takes a few moments


    In my case, this resulted in an error.
    Now, I’m not sure if I missed anything although I made sure everything was correct. And when I checked after some time, it was enabled even without me retrying it. But it could just be for me and might work correctly for you.


Recording of Auditing

Let’s test a scenario where a User is not an Admin User and they try to access the Account record on which we’ve enabled Single and Multiple User Access Auditing –

Please note that it takes about 3-4 hours to the log information to be available in (https://compliance.microsoft.com/homepage)

  1. Now, if you navigate to Audit and search.



  2. Make sure your criteria is as narrow as possibly by including only the user you really want to find if that’s the case
    In my scenario, I was logged in as Priyesh Wagh user and opened a record in CRM.

    So, just to look at what all was logged, my search criteria will look like this –
    I’ll make sure All Dynamics 365 Activities is selected if you want to look at everything which is D365 CRM related.



  3. Next, since I’m only looking for my own user who opened the CRM record, I’ll search and select the user in the below filter.
    Not to mention the time frame is also narrowed to get limited results. 😊


  4. Here, my results will show up.


    If I zoom on in, I’ll see the different types of logs that are filed in the Compliance Center – The retrieve Account is the actual record where all the other events are registered based on the different controls that were loaded when I opened the record itself.
    In my experiment, I opened the same record twice, so it recorded the Retrieve account twice along with other event logs.


  5. If I open the record, I’ll see this info about everything that was tracked along with the link to the record as well –

You can refer the full Microsoft Docs reference – https://docs.microsoft.com/en-us/power-platform/admin/enable-use-comprehensive-auditing?WT.mc_id=DX-MVP-5003911

Hope this summary was useful!

Here are some more Dynamics 365 Administrator related posts you might want to check –

  1. Enable Plug-in Profiler in Settings area in SiteMap in Dynamics 365 | [Quick Tip]
  2. Disable Recent Records from Dynamics 365 Lookup Control | Model-Driven Apps [Quick Tip]
  3. Language format for Whole Number field in Dynamics 365 CE
  4. Custom Help Pages and Guided Tasks for Unified Interface in Dynamics 365
  5. Make Managed fields Required in Dynamics 365 – Managed Properties Error [Workaround] | D365 CE Quick Tip
  6. Sign up for a Dynamics 365 Project Operations (Lite Deployment) environment and provision a new instance | Power Platform
  7. Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
  8. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  9. Duration field in Dynamics 365 converts Hours value to Days in Dynamics 365 | [Flow Workaround to convert in Hours and Mins]
  10. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365

Thank you!

Split On in Power Automate in SharePoint trigger for Item updates

Let’s consider this scenario where you have a SharePoint List and you need to Bulk Edit the same which triggers a Flow.

How would you want to capture the record updates in Flow Runs – Individually? Or all in an Array?

Let’s see how this can be done!

SharePoint Trigger in Power Automate

Let’s see what trigger is being used on which I can choose to have Split On in case of Bulk Update of Item Changes.

  1. In Power Automate, you can search for SharePoint and you’ll find the trigger on which for Item Update in SharePoint.

  2. Now, since I have a List called 2021 Onboarding in my SharePoint in the Site called Data Store Internal


  3. And this Flow will be triggered whenever there’s an Update to the Items on the List I’ve mentioned above.

Split On

Let’s look at what options are available us to toggle between having Split On and Off and what the results are –

  1. Go to the Settings of the Trigger to access the Split On setting toggle.


  2. You’ll see the Split On is set to ON i.e. as per below –


  3. Given that this can be turned ON and OFF, we’ll look at the difference between the two results when you Bulk Edit SharePoint Items which will initiate this trigger.

Example: Split ON

Now, let’s review how having Split On will affect the results.

  1. Now, let’s see Flow Runs are recorded when Split On is set to ON and the Split is on Body/Value


  2. Now, when I modify multiple items in SharePoint, say, the Group Code field in my SP List as below –


  3. Then, there will be 2 different Flow Runs.


  4. Now, if you look at the results, the way these exist per Flow Run is as follows. And for each record, this is the case –

Example: Split OFF

Now, let’s review how having Split OFF will affect the results.

  1. Now, once the Split is OFF and you Bulk Edit the records.


  2. And when you Bulk Edit the List in SharePoint the same way as you did above,


  3. Only 1 Flow Run will be created as shown below –


  4. And, if you open the results, you’ll see the multiple items in the body – value (Array of each record as value in the body) which were modified.


Hope this was useful!

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

  1. Admin Center URLs under M365 – Power Platform, Teams, SharePoint, Power BI
  2. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  3. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  4. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  5. Advanced Lookup in Model-Driven Apps | Power Platform
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  8. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  9. Save generated PDFs to SharePoint directly – 2020 Wave 1 | Early Access Feature
  10. D365 Ribbon Button shortcut to open a Document in SharePoint Online

Thank you!

Action.ShowCard vs Action.ToggleVisibility in Adaptive Cards | Microsoft Teams

If you are new to Adaptive Cards, it may come across that Action.ShowCard and Action.ToggleVisibility seems to do the same thing.

But let’s look at the difference between the two!

To

#ActionDescription
1ShowCardShows or Hides a Card Structure enclosed on ShowCard Action
2ToggleVisibilityShows or Hides individual elements based on their IDs

Action.ShowCard

Below is JSON to understand the structure of how ShowCard Action exists and how it will function

  1. ShowCard is a standalone ‘Card’ within an Action Element CardAction.



  2. Now, let’s see how it works. When the Card is not shown, only the button will appear like any other Action button in AdaptiveCards.


    And when you click on it, the Show Card action will reveal the Card that is structured under it.

Action.ToggleVisibility

Similarly, let’s look at how ToggleVisibility will work as opposed to Show Card.

  1. The JSON structure for ToggleVisibility in ActionSet is as follows –
    Notice that the type: Action.ToggleVisibility



  2. Now, the “targetElements” in the above Action takes in array of Element IDs which should be toggled for Visibility.
    Since, I’ve mentioned only 1 element in it whose ID is “createdDate“, below is how the element looks and where you can get the ID from –


  3. Now, when I click on the button, it’ll consider all the element IDs mentioned in the array to toggle between Show / Hide.
    Before I click the button –



    And when I click on the button, the visibility is toggled to show this time –


  4. So as opposed to ShowCard, ToggleVisibility will toggle Show/Hide functionality of selected elements and not a Card structure that resides inside a ShowCard Action.

Placing Action Elements – ShowCard and ToggleVisibility

  1. By default, if you select an Action from the Elements menu on the left hand side, they’ll end up in the shown hierarchy.


    And the JSON for this will appear like this –

    The type of Element which resides in Body of the AdaptiveCard itself


    Zoomed Out, it’ll look like this –


  2. However, if you don’t wish to have it under an Action Set in the Body structure, you can place the type of Action whether it is ToggleVisibility or ShowCard in Actions section of the JSON as well.


    And this will exist in the Actions of the AdaptiveCard JSON and not in the Body as shown above.


Here are some more posts related to Adaptive Cards / Microsoft Teams which you might find useful –

  1. Save Adaptive Cards work using VS Code Extension – Adaptive Cards Studio | Quick Tip
  2. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  3. Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
  4. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  5. Admin Center URLs under M365 – Power Platform, Teams, SharePoint, Power BI
  6. Tag a User in a Microsoft Teams post made using Power Automate
  7. Asynchronous HTTP Response from a Flow | Power Automate
  8. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate

Thank you!!

Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate

As Dataverse connector keeps getting updated from time to time, here’s a new Search rows (preview) Action which you must be seeing in the Dataverse connector in Power Automate. Let’s see how we can use this Action.

As it suggests, that this is still in preview! So kindly take a note of that.

Search Rows (Preview)

  1. Search rows is an Action in the Dataverse connector and you’ll be able to see it like this

Enable Relevance Search

  1. Let’s assume you went ahead and used this connector in your Flow without having Relevance Search enabled in your D365 CE organization, you’ll see the Search Rows throw the below error.


    And the error is described as –

  2. To make Search Rows work, Relevance Search must be enabled for you Dynamics 365 CE / CRM environment. Head over to the System Settings in Dynamics 365 under Settings > Administration > System Settings. And in General tab, look for Relevance Search option, check-mark it and save.


  3. Here’s the full Microsoft Documentation on how to use queries for Relevance Search – https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/relevance-search?WT.mc_id=DX-MVP-5003911

Using Search Rows action

Let’s see how this Action from the Dataverse connector will work –

  1. Now, once you have selected the Search rows action, below are the features which I’ll explain one by one –

  2. Let’s first look at the last item i.e. Return row count. As it says, will result the count of results returned if set to Yes.
    Will return -1 if set to No.

  3. For Search Type and Search Mode to be covered, these need to be explained extensively since it covers several factors. To keep it short for now, I’ve linked the Search Type and Search Mode documentation as below
    https://docs.microsoft.com/en-us/power-automate/dataverse/search#search-type?WT.mc_id=DX-MVP-5003911

    And the short Summary of the same is:
    Search Type:simple | full” There are 2 types called as simple and full. Default = simple. Both have different functions within them that you can use on the Search Term.

    Search Mode: “any | all” By Default – any. This defines if any criteria of the Search Term is to be considered or all must be true based on different syntax and operators used.
  4. Row Count denotes how many records should the results Return which is standard across other Dataverse actionss.
  5. Also, Row Filter uses OData style filtering which we’ll omit in this example to keep it simple. 😊
  6. Now, let’s enter a Search Term and keep it simple, I’ll pick an example: “Contoso“.
    Next, look at the Table filter – If I leave it blank it’ll search for Contoso across all Tables in Dataverse.


    Result to show from all Tables as per the above Search rows term –


    Now, I’ll add account and contact (I do have some records in the Opportunity as well which has the keyword ‘Contoso’. So those will be filtered out)


    And the result will be as follows –


    And if we look at the Raw Outputs to see how data is retrieved, we get the below –

  7. Now, let’s look at Sorting.
    Now, in the Sort by filter, I’ll enter the field name ‘name‘ and desc as the order of the Sort.
    And then, we’ll check the results


    And the results were as below –


  8. Next, let’s look at Facet Query. basically, it drills down on the Results which are already returned as a part of the main query and serve as metadata for the same to gather similar information together.
    Here’s how I enter a Facet query – Ex: contact.address1_city. Meaning, it’ll return Address 1: City from all the returned Data and store it under Facet Query.


    Now, when we run this, we’ll get the following results –


  9. Let’s look at what Skip Rows does.
    It’ll only omit the records from the already returned Results. Example: Even if the Result returned 5 records, it’ll Omit/Skip first x records. But still show that the Results returned are whatever the Query is supposed to return.

    In the below example, out of 5, I’ll skip 4 rows.



    And when you run the Query, you’ll find that the Record Count is 5, but only 1 entry was available in the Output.



Which Columns are Searchable?

There are 2 points to keep in mind to know and configure which all columns will the Search be performed on.

  1. If you are aware of how you can configure the Quick Find views in Dynamics 365 CE, same is applicable here since this works off of Relevance Search itself.
    In any Table/Entity’s Quick Find view, make sure the columns are selected in the Add Find Columns

  2. The ones selected in Find Columns are the ones on which the Search will be performed.

Here’s a YouTube video I made to demonstrate the same –

Hope this was useful!

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

  1. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  2. Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate
  3. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  4. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  5. Asynchronous HTTP Response from a Flow | Power Automate
  6. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  7. Tag a User in a Microsoft Teams post made using Power Automate
  8. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  9. Formatting Approvals’ Details in Cloud Flows | Power Automate
  10. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  11. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  12. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip

Thank you!

Custom Help Pages and Guided Tasks for Unified Interface in Dynamics 365

Formerly, Learning Path – A complete new overhaul for guided help is Custom Help Panes in Dynamics 365



Enable Custom Help Panes

Access your System Settings for enabling this feature in your organization –

  1. Go to Settings > Administration > System Settings. Then switch “Enable Custom Help Panes and Guided Tasks” to Yes if already set to No.


Creating Custom Help Panes

Let’s see how you can configure these Custom Help Panes in your Dynamics 365 CE environment for different environments –

  1. For example, for Contact entity, if you navigate to the Question Mark option on your top navigation bar, a Custom Pane will show up. If the above System Settings is not turned on, it’ll navigate to Microsoft Docs instead.

  2. It’ll expand the Pane as follows. You can then click on the three vertical dots as shown and click on Edit –

  3. Once you Edit, you’ll open the Custom Help Pane editor on which you can start configuring the Help Pane.
    You can Start Editing the Pane. You can start by entering the Title and then move down to add different Help items to the Pane.

  4. Now, I’ve added Title of the Page to Contact Help. You’ll see Save button at the button where you can Save the progress. Now, I’ll go to Insert and add a Section.
    The first item is Insert a Section.


  5. Open clicking Insert Section, I can add a title to it. Now, I’ll label this section as General.
    And it will appear as below.



    Now, you can click inside the General section and can add rest of the items there.

  6. Next, I’ll insert a Link into the General section.


    And I’ll complete the below Info for the Link.


    It’ll appear as below –

  7. Next, I’ll Edit the Pane again. And select Coachmark.


    And add Coachmark details as follows –


    Now, you can drag to where the Coachmark should be highlighted when clicked.

    Now, when you click on the generated Link, the coachmark will prompt.


  8. Next, let’s insert a Balloon.


    Enter details on the Balloon like the Link title, actual Title as it should appear on the Balloon and the Details it should read out. Finally, drag the Balloon to the element.


    And here it drag it to a relevant field.


    And finally, when the link is clicked in the Pane, the Balloon will appear as below.







  9. Next, Let’s insert a Video.


    And enter the URL of the video and set preferences accordingly.


    Once Inserted, it’ll look like below.


  10. Now, the final Items which we will insert here is an Image.


    And it’ll ask me for a Image URL which is accessible over the Internet.


    And it’ll appear as below –





    I’ve also added a YouTube video explaining the above steps in case anything from the above was not already clear –

Help Page record

In Dynamics 365, the Help Page record looks as follows if you do an Advanced Find –


You can even move this between environments within solutions itself. You can test this out in the new make.powerapps.com Solutions and Add an Existing Help Page as shown below –

Hope this was helpful!

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

  1. Sign up for a Dynamics 365 Project Operations (Lite Deployment) environment and provision a new instance | Power Platform
  2. Make Managed fields Required in Dynamics 365 – Managed Properties Error [Workaround] | D365 CE Quick Tip
  3. Sign up for a Dynamics 365 Project Operations (Lite Deployment) environment and provision a new instance | Power PlatformFilter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  4. Duration field in Dynamics 365 converts Hours value to Days in Dynamics 365 | [Flow Workaround to convert in Hours and Mins]
  5. Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
  6. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD
  7. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
  8. Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
  9. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  10. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  11. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  12. Track and Set Regarding are disabled for Appointments in Dynamics 365 App For Outlook message | Demystified

Thank you!!

Navigate Screen automatically based on Timer in Canvas Power App | Power Platform

So let’s say you want to auto-navigate from a Screen to some other Screen in a Canvas Power App. [Or any other operation for that matter!]


The purpose of this post is to demonstrate how you can use a Timer control in Canvas Power App to automate some operations in your Canvas Power App!! So let’s see this scenario of navigating between screens

Scenario

Let’s consider this scenario. You want to display a Splash Screen on your App upon submission of a record notifying the user about some short info and then redirecting to the Main Screen. You don’t want the user to press a button but only want to redirect automatically after 4 seconds, for example.

  1. Here’s your Home Screen, Main Screen and Success Splash Screen.
    In this scenario, you want to create a New Record in NewAccountScreen, then redirect to SuccessScreen upon record submission.
    And once the timer times out as specified, you need to redirect from SuccessScreen to Home Screen.


    Here’s how the Success Screen will look –

Using Timer to Navigate between Screens

Now, let’s look at how we can achieve this –

  1. Take a Timer control on the SuccessScreen. Here’s how you can add a Timer from the Input menu.


  2. Now, the Timer will appear as below. You will need to hide this later on. For now, we’ll keep this on screen to see the behavior and design the logic.

  3. Now, we need to set a few parameters of the Timer –
    Duration, you can specify in milliseconds here. Example: 3000 i.e. 3 seconds

  4. Next, you’ll need to set the Start flag. By default, this is set to false. The Start is triggered when the value it set to True. This needs to be dynamically set from elsewhere i.e. in this example, you’ll need to trigger from where you come to this screen so that the Timer starts the countdown.


  5. Now, the way I set this is, first I create a variable from the place where I want to trigger the Timer to go-off. From the Form Submission screen in this case.
    Now, if you see below, I’m Submitting the Form i.e. creating a new record. Then, I’m navigating to the SuccessScreen. And, finally, I’m creating and setting a variable called startTimer and set the value to true. As the Start property of the Timer accepts a Boolean value.


    Then, I’ll set this variable to the Start.


  6. Then, you’ll need to set what needs to happens when the Timer ends. So, you have to write the OnTimerEnd property as to what will happen once the Timer ends.
    Here, you’ll Navigate to the ‘Home Screen’ as per our scenario and then also, set the startTimer flag to ‘false’ since you want to reuse this again for the next submission.

  7. That’s it!! Let’s see how this will work. And you can absolutely have any different scenario which you want to do with a Timer.

Also, here’s the Microsoft Documentation on the Timer Control for Canvas Power Apps – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-timer?WT.mc_id=DX-MVP-5003911

Working

So, here’s how it will behave. For demo purpose, I’ve kept the Timer visible on screen for you to see it in action –

Hope this was helpful!

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

  1. Search on multiple columns from a Dataverse table in a Canvas Power App Gallery control | Power Platform
  2. Call a Flow from Canvas Power App and get back response | Power Platform
  3. Enable Custom Code Components (PCF Controls) to be imported in a Canvas Power App | Quick Tip
  4. Retrieve Hashtags from Text in a Canvas Power App | Power Platform
  5. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  6. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  7. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  8. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  9. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  10. Implement character length validation in a Canvas Power App | Power Platform
  11. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  12. Variables in Canvas Power Apps | Global and Context

Thank you!

Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate

While using Dataverse connector [formerly known as Common Data Service (Current Environment) connector] for different operations, List Rows is one of the common Actions we use in Flow implementations with Dataverse.

If using FetchXML Query as filter is your choice, there one of the most common issues with an XML is having an Invalid XML due to the special characters in the data we are passing.
Many times, this issue goes unidentified since we end up checking only syntax!

Here’s what you can also add as an additional check to escape the special character scenario in FetchXML query in a List Rows action.

Invalid XML Issue – Special Character

Let’s look at one of the common examples where you’ll see this error on runtime when a FetchXML issue appears

  1. You have a Flow wherein you are using FetchXML query to list records in Dataverse connector using List Records action.


  2. But when happens is, when this Flow Runs, it results in an error on the List Records step.


  3. And if you look at the right hand pane for the error, it could be a Invalid XML error which you would get in Dataverse (or while working in Dynamics CRM if you have experienced in the past).


  4. So, let’s look at what could be wrong in this case among several other reason of using FetchXML and getting syntactical errors.
    If you look at my XML below, it looks like there could be some parameters that have special characters in them and hence, your XML might fail if not anything else.


    Let’s look at how we can resolve the same.

encodeURIComponent() function

As a solution to this, you can use the encodeURIComponent function in Flow to counter this problem –

  1. Now, in ideal cases, you parameters could be coming in from elsewhere which you would add in the FetchXML as parameters.
    Let me store the same in a sample String Variable for now.


    In the Value, I’ll look for an expression called as encodeUriComponent()



  2. Then, I simply enter the value which I’ll pass on to the Fetch XML filter to be used later on. And then I enter the value in the function.


    And it looks like this in your variable.


  3. Now, you just pass this on to the Fetch XML itself.

  4. And now, this should work successfully

Here’ is the Microsoft Docs of the function to encore URI and help streamline special characters – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#encodeUriComponent?WT.mc_id=DX-MVP-5003911

Hope this was helpful!

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

  1. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  2. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  3. Asynchronous HTTP Response from a Flow | Power Automate
  4. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  5. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  6. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  7. FormatDateTime function in a Flow | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  10. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip

Thanks!!

Search on multiple columns from a Dataverse table in a Canvas Power App Gallery control | Power Platform

One of the most common scenarios is to be able to perform a Search on the Dataverse table like Accounts, Contacts etc. across multiple columns. Just like you would do on a Quick Search in a Dynamics 365 CE (CRM).

Let’s see how we can replicate this using Search() function in Canvas Power App to implement Search across multiple columns in a Canvas Power App.

Gallery and Search Control

As a typical setup, I’ll implement a Gallery control to populate all Accounts and have the Search Text Input control for the user to enter the search term. Let’s see how we can set this up quickly –

  1. I’ve added a Gallery control that will populate the Accounts from the Dynamics 365 (Dataverse) instance and I’ve added a Search which is a Text Input which user can use to enter the Search term.


  2. Here are the fields which are selected to be displayed on the Gallery. Account Name will be shown larger in bold and below is the City to give it a subtitled look.


  3. Once this is set, we’ll look for Items of the Gallery and proceed to modify it. You’ll see the Default Items populated already based on how you populated the Gallery when you connected to your Dataverse.
    Let’s modify this.


  4. Now, we’ll clear the Items formula bar and then write the below Search() function –

    Search – Denoted by Blue arrow, Search() function is used in Canvas Apps to Search from a Data Source but first selecting thee data source in the first parameter, then the Search Term and finally listing all thee columns of the data source separated by commas. Here’s thee official documentation of the Search functionality as provided in Microsoft – Docs https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup?WT.mc_id=DX-MVP-5003911

    Accounts – Denoted by Green Arrow, Accounts if the Data Source i.e. thee Dataverse environment which is fetching theee Accounts table and populating the Gallery.

    SearchInput.Text – Denoted by Orange arrow, SearchInput.Text is the text which users will enter to Search from the Dataverse i.e. from Accounts table in order to show up.

    Fields – Denoted by Red Underline, the fields can be listed from the Data Source and the Search will be carried out amongst those columns.

Working

Now, let’s see how this will work –

  1. By default, if the Search Box is blank, all the records will be shown.


  2. Once, users start to enter text into the same, the Items of the Gallery will start populating based on the Search.


    I’ve also implemented this using the Filter function as well – Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform

Hope this was useful!

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

  1. Call a Flow from Canvas Power App and get back response | Power Platform
  2. Enable Custom Code Components (PCF Controls) to be imported in a Canvas Power App | Quick Tip
  3. Retrieve Hashtags from Text in a Canvas Power App | Power Platform
  4. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  5. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  6. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  7. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  8. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  9. Debug Published Canvas Power App with other users using Monitor | Power Platform
  10. Download a File from a Canvas Power App using a button | Power Platform
  11. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform

    Thank you!!

Call a Flow from Canvas Power App and get back response | Power Platform

One of the most commonly searched topic is being able to Run a Flow from a Canvas App. And this has been demonstrated by many users over a period of time.

This is my attempt to summarize the same. Hopefully, this will clear out in a simpler way!!

Scenario

In this scenario, I will call a Flow using a Button and send the number in the TextBox, the Flow will do some calculation and I will get back the result which I’ll use to store and utilize. Simple!

Create a Flow

Let’s see how you can add a Flow to Canvas Power App –

Before we begin, remember, only the Flows which are outside a solution will be recognized inside a Canvas App.

  1. Here is my Cloud Flow. Since the Trigger of the Flow is a Canvas Power App, I’ll search for PowerApp in the Connectors and select the PowerApps connector.
    It has 1 trigger which is called as PowerApps.


  2. Once I select, I start the Flow with the trigger and then I’ll go on to declare 2 variables to do a simple operation.


  3. Now, I want to request Number 1 in the Canvas PowerApp which will be passed to the Flow.
    So, in the Dynamic content, you’ll notice Ask in PowerApps

  4. As I select this, a variable will be auto-created with will be the name of the variable “Number 1” (spaces will be removed), followed by _Value. Hence, resulting in Number1_Value.


  5. Next, I’ll create another variable to just multiply these 2 numbers together and produce a result. So, here’s my third variable. (Just for the sake of this example 😊)


  6. Now, to send back a Response to the calling Canvas PowerApp, I’ll again search for PowerApps connector in which and then look for the Action which is called as Respond in Power App

  7. Once I select that, I can then pass on my variable which is a result of my calculation.


  8. And I’ll send the result back to the calling PowerApp.

Accepting Parameters in Flow from Canvas App

Let’s look at the other part of the implementation where I will have a button pass value to the Flow and get back results.

  1. In my Canvas App, I have this structure where I have a Textbox called ‘ValueToSend‘, a button called ‘ProcessButton‘ and a DataTable called ‘ResultTable‘ to show the result.

  2. Now, in order to add a Flow on the trigger of the Process Selected button, I’ll select the button first and then make sure OnSelect is highlighted and then follow the step below.
  3. Now, let me add the Flow to the App first. I’ll navigate to Action and click on Flow.

  4. Upon selecting Power Automate, I’ll be shown all the Power Automate Flows detected by the App. Remember, only ones NOT in Solutions will be detected and available for selection.

  5. Upon clicking it, it will be added to the Power App and appear in the Data above and the Flow will be ready in the Formula Bar for you to complete calling it.


  6. Now, as you click on the Formula Bar to start writing the Flow, you’ll be asked the first parameter which we added as Ask In PowerApps in our Flow above.

  7. So, I’ll enter the TextBox which I had created i.e. ValueToSend, for example. And then close the Flow and then enter a dot to select the Outputs for Flow has to offer.
    As you see, I can now select the Output Parameters which we had selected.

  8. Once I select that, the Flow will send the value that I pass and collect back the calculatedValue from the Flow.



  9. Now, this is not stored anywhere, so it’s recommended you store it in a Variable/Collection for your use later.
    In my case, I’ll add it all to a Collection to populate the DataTable later on. Hence, I’ll add the entire thing to the Collect() method


  10. Next, since I want to display thee result in the label, I’ll assign the Label’s Text property to the variable I created above and collected Flow result in.


    Now, let’s Run this example.

Running

Now, when I call the Flow by pressing the button once I enter some value, the result will be calculated and the Collection will store the answers sent back by the Flow and it’ll keep adding to the collection on each request.

Likewise, your scenario could be anything per your implementation.

  1. First call to Flow


  2. Second call to Flow

Hope this was useful!!

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

  1. Retrieve Hashtags from Text in a Canvas Power App | Power Platform
  2. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  3. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  4. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  5. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  6. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  7. Debug Published Canvas Power App with other users using Monitor | Power Platform
  8. Download a File from a Canvas Power App using a button | Power Platform
  9. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  10. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  11. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  12. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists

Thank you!

Retrieve Hashtags from Text in a Canvas Power App | Power Platform

Let’s say you want to make a collection of Hashtags used in a certain Text Input control. Here’s how you do it using the HashTags() function in Power Apps.

Let me demonstrate it quickly below!

Using HashTags() function

Now, let’s consider the below scenario where you want to collect the Hastags from a Text Input and later on use business logic on that.

  1. As an example, let me take a Description multi-line text field on the Canvas App and I’ll also take a DataTable to show the collected Hashtags in the same.
    I’ve renamed the Text Input to “Description”

  2. Now, to scan for hashtags and collect them, I’m writing the below formula on the OnChange operation of thee Text Input so that once I finish writing and move the focus away from Text Input, the Formula can scan for Hashtags and populate the collection.



  3. Now, here’s the formula I’ve used to scan the Text (String) for Hashtags present.


    Microsoft Docs Link for HashTags() formula –
    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-hashtags?WT.mc_id=DX-MVP-5003911

    Why ClearCollect instead of Collect? – Because only using Collect will scan the field and add all the hashtags again causing redundancy.

    Why I used Collection? – I could also use this collection elsewhere instead of directly assigning the above formula to the Items of the Data Table. Hence, the preference to use ClearCollect.

  4. Now, from the Data Table perspective, I’m simply populating the Data Table with the Collection [hashtagCollection] as the Data Source and make sure you also add the Result column as well, else, the Data Table will be blank even if the Collection is being populated.

Working

Let’s see how the table will be populated as we Run the App.

  1. Now, I’ve written as Hello #PowerPlatform and moved the focus out of the Text Input, the Data Table (via Collections) is populated with the results.


  2. Again, if I add another Hashtag i.e. #PowerApps, it’ll add to the collection (Basically, erase everything and scan all over again behind the scenes)

To demonstrate this example, I’ve created a YouTube video for the same, kindly check it out!

Hope this was useful. Here are some more Power Apps / Power Platform posts you might want to check out –

  1. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  2. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  3. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  4. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  5. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  6. Implement character length validation in a Canvas Power App | Power Platform
  7. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  8. Debug Published Canvas Power App with other users using Monitor | Power Platform
  9. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  10. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps

Thank you!!

Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector

For newbies using Common Data Service (Current Environment) Connector, it might be a little puzzling to find all the records and other supporting output data while parsing from a List Rows action in the connector.

Here’s my post summarizing the same and helping you show what is in the output when and then you can make a decision!

Before we begin, please note the connector Icon at the time of writing this post – The tooltip if hover on will read as “Common Data Service (Current Environment)

List Rows

So, here’s what my List Rows action looks like

  1. I’m retrieving 10 Accounts in this example

  2. Now, I’m adding 4 Parse JSON variables to hold the different Outputs from the Dynamic Content of the List Rows.
  3. I’ll rename the first Parse JSON as Value and add Value from the Dynamic Content from List Rows output


  4. Second, I’ll rename the Parse JSON to Body and add Body from the Dynamic Content to it.

  5. Third, Parse JSON is renamed to Item and I’ll select the body/value – Item first.


    And as soon as I do that, the Block gets converted to For Each, because Item is list of all the records directly

  6. Finally, in my fourth Parse JSON block, I’ve renamed it to Outputs of List Rows and added the outputs of the List Rows step itself using outputs() function – More on outputs() here – Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate


    Now, let’s Run the Flow and see what results we get!!

Value / Body / Item

Now, let’s look at the output JSON data from each of these blocks and see what we get –

  1. Value. I used JSON Beautifier to parse and look at the JSON data and here’s what it looks like.
    Body attribute and has array of all the records.


  2. Next, Body. Body has similar data as values but with some additional attributes to support the same.
    Then, the array of all the records under Value attribute instead of directly appearing under Body in the Value block above. I know it’s a little puzzling — 😊


  3. The, Item. It’s a simple JSON of a single record itself. Hence, it exists inside a For Each loop


  4. And finally, the outputs() of the List Rows action entirely, it has Body, Header and other


    But, note that the Body is also another attribute inside the main Body tag and sits next to Headers and StatusCode

I’ve also embedded my YouTube video explaining the same –

Here are some Power Automate / Flow posts which you might find worth checking out –

  1. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  2. Asynchronous HTTP Response from a Flow | Power Automate
  3. FormatDateTime function in a Flow | Power Automate
  4. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  5. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  6. FormatDateTime function in a Flow | Power AutomateUsing outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  7. Formatting Approvals’ Details in Cloud Flows | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  10. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Thank you!!

Asynchronous HTTP Response from a Flow | Power Automate

By default, whenever yo submit an HTTP Request to a Flow, your application will wait till the request is completed. Meaning, the HTTP Response by default in a Cloud Flow is Synchronous.

So, let’s see how you can make it Asynchronous and how you can later retrieve the status of the HTTP Request itself from the Flow. If you make a HTTP Response as Asynchronous, the calling HTTP Request application will receive a 202 Accepted in response.

HTTP Request by Default

Let us see how the HTTP Request and Response is structured by default.

  1. Here’ s the HTTP Request which will receive the request and process the data further.

  2. And let’s assume you some lengthy process involved in your Flow which is making an average execution time span to a significant time. To mimic that, I’ve simply introduced a delay of 3 minutes to demonstrate the Async example.

    In case you want to review how to pause a Workflow using Delay and Delay Until, you can check this post – Pause a Flow using Delay and Delay Until | Power Automate
  3. And finally, assuming my execution of the Flow has completed and I’m supposed to send the Response back to the HTTP Request calling application, I’ll use the Response Action from the Request connector
    }
  4. And my Response will look something like this letting the caller application know that the processing has been successfully completed.


    Now let’s see how this calling application will behave in this case. Assuming, we haven’t manipulated any settings as yet.

    The Flow looks like this just to give you a visual perspective of the implementation.

  5. Now, Once I send a Request from Postman, the Postman itself will be waiting for a response till the execution of the Flow is completed.


  6. This is because the Flow itself is waiting to be processed and yet to reach the Response block in the Flow.

Asynchronous Response

We will now turn on the Asynchronous Response of the HTTP Response Action –

  1. Go to Settings on the Response action step.


  2. In Settings, turn on Asynchronous Response On and save it.

  3. As mentioned in the description of the Asynchronous Response setting, the caller Application will immediately get a 202 Accepted code upon sending the HTTP Request.

  4. Notice the Headers, you’ll see a Location header item

  5. Capture this URL in your calling application as you can use it to check the status of the Request later on once the operation is completed on the Flow.

Checking Request Status

Since we have the Location information which was passed on from to the Response Header previously, we can use the URL to check the Response Status separately by making another call to the URL itself.

  1. If the Status is still Running, you’ll get this response. It will imply that the Flow is still Running and the Response is not available yet.


  2. Else, you’ll get the actual Response which was supposed to be received had the Flow’s HTTP Response was set to Synchronous by default (Asynchronous Response = OFF)


Hope this was helpful!

I’ve added a YouTube Video for the same. You can alternatively, check the same as well –

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

  1. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  2. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  5. Make HTTP request from Flow in Power Automate
  6. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure ADFormatDateTime function in a Flow | Power Automate
  7. Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
  8. FormatDateTime function in a Flow | Power Automate
  9. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365Formatting Approvals’ Details in Cloud Flows | Power Automate
  10. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  11. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  12. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  13. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  14. Run As context in CDS (Current Environment) Flow Trigger | Power Automate

Thank you!!

Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate

In a Cloud Flow, if you are using an HTTP Request Trigger that accepts HTTP Requests – you have the option to validate the Incoming data based on the Schema of the JSON.

Scenario

Let’s assume this is the data which will be passed to the HTTP Request Flow –



HTTP Request & Schema

Let’s look at the HTTP Request Trigger itself in a Cloud Flow –

  1. First, let’s initiate the HTTP Request Trigger here and make sure we generate the Schema from the same data we will be passing. I also have a separate post on the HTTP Request itself which you can check here – Accept HTTP Requests in a Flow and send Response back | Power Automate
     
  2. Here, we can paste the sample data which we saw in the scenario above.

  3.  Once you click Done, the Schema will be generated from the sample data you’ve just entered. Additionally, if needed you can also specify the method you are looking to implement. POST in this case


  4. Further on, I’m doing some operations internally and finally, I’ll be sending a response to the caller using the HTTP Response Action in HTTP connector in a Cloud Flow

  5. And here is what I’m sending back in Response if my Flow happens to work as expected.

  6. So, the end of my Flow looks something like this. (Depending on what you are trying to do in your Flow)



     

Turning Validation On

Now, coming back to the HTTP Request trigger itself –

  1. Go to Settings on the HTTP Trigger itself –


  2. Now, look for Schema Validation option and turn it on.


Now, let’s consider the scenario and test the Postman.

Testing with Postman – Validation On

Let’s try to send incorrect data to the Flow using Postman which doesn’t comply with the Schema and see how we receive the 400 Error message in Postman

  1. Now, when I try to send the correct data as expected by the Schema once the validation is turned on, I’ll get a success message once the Flow has finished running and return with a 200 code


  2. Now, if we try to send incorrect data, it will not be accepted. So first, I’ll add a new attribute which I’ve not added in the schema already in order for the validation to fail and give us an expected validation error.
    See the data which I’m sending. To which, I get the 400 Bad Request error

  3. If you get back a 400 Bad Request, the Flow will not register it as a Flow Run. Hence, you won’t know if the Flow was hit or not.
  4. And in case the validation is turned OFF, you’ll get the Response as expected from the Flow in the event that Flow has completed successful execution.

Hope this post helped!

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

  1. Tag a User in a Microsoft Teams post made using Power Automate
  2. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  3. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  4. FormatDateTime function in a Flow | Power Automate
  5. Formatting Approvals’ Details in Cloud Flows | Power Automate
  6. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  7. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  8. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  9. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  10. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  11. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  12. Secure Input/Output in Power Automate Run History

Here are som

Converting JSON to XML and XML to JSON in a Flow | Power Automate

In this very simple post, let’s look at how you can convert JSON to XML and XML back to JSON while working in Power Automate.

First, let’s look at converting JSON to XML and then, XML to JSON from the same result of the first conversion.

JSON to XML

Let’s look at an example where we have a sample JSON which we will convert to XML in Power Automate using xml() function and we’ll revert the same operation using xml() function in Power Automate itself.

  1. So starting off with JSON data, you’ll need a String based JSON data. I’ll store the same in a variable which looks like below.

  2. If I format the same data in JSON formatter online, it’ll look like this –


  3. Next, we can use the formula xml(<jsonData>) in the expressions and use it as below

    Now, since I’m storing my JSON data in String already, I’m converting it to JSON by using json() function inside the xml() function.
  4. The result of the same is as below

  5. And if we take it to an XML formatter, it’ll look like below
Let’s look at what won’t work
  1. Cannot use an Array and there can be only 1 Root element. Hence, the below won’t work –
    You cannot have an Array of JSON elements which looks like below –


    It will result in the below error saying, “The template language function ‘xml’ parameter is not valid. The provided value cannot be converted to XML:’Data at the root level is invalid…


  2. Also, when it is not an Array already, but there are Multiple Attributes at the Root level itself, it won’t work either. Something like below –

    Or if we format and look at it, the Name and the Newsletters is the same Root level –

    Which will result in the below error ‘The template language function ‘xml’ parameter is not valid. The provided value cannot be converted to XML: ‘JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifying a DeserializeRootElementName. Path ‘Newsletters’.’

XML to JSON

Similarly, let’s see how we can inverse the conversion now from XML back to JSON –

  1. In this post, we are taking the same XML result which we first converted from JSON back to JSON again. But you can start fresh or take the source from elsewhere, of course.
    The formula to convert from XML to JSON is

    Like in the previous step, the XML was in String as a result captured from the previous step and we need to convert it to XML first in order to convert it to JSON.

  2. The result is as follows –

  3. Also, like in the previous JSON to XML conversion, Root level node has to be present. Else, you’ll see the following error in case you don’t have a root for the XML.


    And it will result in the below error

Official Microsoft Links for the above functions are –

  1. JSON – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#xml?WT.mc_id=DX-MVP-5003911
  2. XML – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#json?WT.mc_id=DX-MVP-5003911

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

  1. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  2. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  3. FormatDateTime function in a Flow | Power Automate
  4. Formatting Approvals’ Details in Cloud Flows | Power Automate
  5. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  6. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  7. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  10. Run As context in CDS (Current Environment) Flow Trigger | Power Automate

Thanks!!

Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM

In Dynamics 365, “My” views show records owned by the System Users themselves. Let’s look at how you can have views that let’s you filter records based on the Owner Team which you are a part of.

Scenario

Let’s assume the below scenario in terms of Contacts entity. All users have Contacts owned by them. Out-of-the-box views show filter “My” views only by Owner field.

  1. Default My Active Contacts view will show you Contacts you are Owner of. (Similarly, this could apply to every other record as well)
    Example: Amit is logged in and he is seeing his Contacts under My Active Contacts




  2. Now, Amit is also part of a Sales Team which is an Owner Team in Dynamics 365 CRM/CE


  3. And, there is a Contact which is assigned to the Sales Team itself and not an individual user.


    I’ll just expand the header and show you the Owner

  4. So, we’ll make this Contact also appear for Amit on his new My Team(s) Contacts’ view. You can call your view something else as well.
    So let’s see we can do this.

Create a new View – Edit Filter Criteria

In order to make the Owner Team’s record available, we’ll have to work by creating a new view and editing the Filter Criteria of the new view. Let’s see how –

  1. I’ve created a new view called as My Team(s) Contacts. And I’ll start by editing the criteria itself.



  2. Start by selecting Owning Team (Team) under the Related section of the fields selection drop-down.



    Under that, open the drop down to expand it’s related records.


  3. Under Owning Team (Team), look for Users. Notice that it doesn’t have any entity name mentioned in brackets like other fields in the list. Meaning, it is the sub-grid i.e. Child Record list under the Team record.

  4. Once you select the Users, expand the dropdown under Users which will be the fields of the System User record itself.


  5. In this list, select User itself. This is the GUID of the User record. Pro Tip: Any field with the name of the entity itself is a GUID/Primary Key of the entity record itself.

  6. And in this last selection, you’ll notice that the Current User is already selected for you.

  7. That’s it. Save your criteria and publish the changes.
    Let’s see the results.

Result

Now, if you navigate to the new view you created with the selected criteria, you’ll see the records Owned by Teams which the logged in user is a part of –

Caveat – Clubbing into 1 view (Owner + Owning Team’s Member) is not possible

Let me point out a caveat right away before we proceed – In case if you are wondering that we can do this in the same view by adding more ‘Related’ entity criteria which will look like the below – it won’t work! 😦

Because, the Filter Criteria will not consider (or let you select these rows in any order) and let you make it in an OR group.
By Default, this is an AND group i.e. a Field + Related criteria can’t be grouped together.
If you set the above criteria in any order, it’ll end up returning 0 results.


Hope this was useful!

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

  1. Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick TipDuration field in Dynamics 365 converts Hours value to Days in Dynamics 365 | [Flow Workaround to convert in Hours and Mins]
  2. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  3. Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
  4. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD
  5. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
  6. Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
  7. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  8. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  9. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  10. Remove ‘This Email has been blocked due to potentially harmful content.’ message in Dynamics 365 Emails | OrgDbSettings utility

Thank you!

Duration field in Dynamics 365 converts Hours value to Days in Dynamics 365 | [Flow Workaround to convert in Hours and Mins]

This must be one of the most common scenarios Dynamics 365 Users must’ve come across. The Whole Number’s Duration field shows Duration in Days once it crosses 24 hours, it shows the Duration in Days. Like below –

And once you leave the control, it’ll be converted to it’s equivalent Days conversion

But if you click on it, you can in fact see the Hours

However, It’s not ideal to click on the field and check the Hours on the form. Also, this doesn’t work in case the field is seem from a View on the entity. Unfortunately, we can’t change this behavior. So, to have a workaround, I created a new field to store the translated value.

Hope this implementation is useful to you. In case of any better ideas, kindly suggest in the comments and I’ll be happy to update this post in order to serve full purpose. 😊
To understand the core conversion using long division, refer this post – https://www.calculatorsoup.com/calculators/conversions/minutes-to-hours.php

New Single Line of Text Field and a Flow

Let’s look at how the implementation is –

We’ll need to also review the following Logic Apps’ Math Functions to understand how to apply them – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#math-functions?WT.mc_id=DX-MVP-5003911

Also, to understand how to read data from triggerOutputs(), check this post – Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

  1. I’ve created a new Single Line of Text field called as Time In Hours (cf_timeinhours) which will hold the translated Hours & Minutes. Making the field as Read-Only is recommended so that no one changes it on the form post update.


  2. Now, here’s a Flow (You can configure it either on demand for existing records of on Create/Update of the Duration field which itself to calculate once the value is changed field). Just for example’s sake, my field is on Contact and hence, I’m triggering the Flow on Update of the contact on the change of the Avg Turnaround Time (Whole Number of format Duration) field.


    See, that the Body of the step will have the Avg Turnaround Time field storing the duration in minutes.


  3. First actions is to use Divide to get the Hours. I’m creating a variable called as Divide To Get Hours of type Float.


    Here’s how the div function included above looks like –



    Formula is: div(triggerOutputs()?['body/cf_avgturnaroundtime'],60)
    Explanation: Duration field in Dynamics 365 stores Minutes. First, we divide these minutes by 60 to get the Hours value.
    If you divide 3375/60, you get 56.25. But the Div will give you the Integer value. (The right way to divide to get exact float is to also store the 60 in a variable and then work with variables. See this post https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-receive-decimal-number-result-after-dividing/td-p/195399) However, in this case, we anyway need to 56 part, so this is fine for now.

  4. Next, we’ll multiply the result of the Hours we got from the step above i.e. Divide to Get Hours.


    Here’s how the Mul function looks –


    Formula is: mul(60,int(variables('Divide to Get Hours')))
    Explanation: Now, we multiple the result of the Divide to Get Hours. This will be used to subtract from the actual value of Avg Turnaround Time field.
    Here, we multiple 60 x 56 = 3360 and get 3360

  5. Finally, to get Minutes, we use the third variable that uses a Sub function


    The Sub function looks like below –


    Formula is: sub(triggerOutputs()?['body/cf_avgturnaroundtime'], variables('Number to Subtract From'))
    Explanation: Now, we subtract the result of the Number To Subtract step from the value of the Duration field i.e. Avg Turnaround Time field itself. These will be the minutes.
    Now, to get the minutes we subtract the result of the Number to Subtract from the actual minutes value of the duration field i.e. 3375 – 3360 = 15. These are your minutes!


  6. Final step is to simply arrange it in a String (you can also form the string elsewhere directly and skip the below)

  7. And to make sense of this conversion, I’ll update the field on the record to show what the converted Hours and Minutes is.

  8. Here’s the final result once the Flow runs successfully.

Hope this helps! You might always want to check more Power Automate / Dynamics 365 posts –

  1. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  2. FormatDateTime function in a Flow | Power Automate
  3. Formatting Approvals’ Details in Cloud Flows | Power Automate
  4. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  5. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  6. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  7. Store ‘Today’s Date’ in a field to use in workflow conditions in D365 CE
  8. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  9. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  10. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  11. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  12. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists

Thank you!

Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox

In ribbon button customization, it is a common scenario to show the button only to a certain set of users who have a certain security role.

Security Role Scenario

  1. Let’s assume Subscription Manager is a security role in your Dynamics 365.

  2. And the Ribbon button will only be visible to the Users who have been assigned this Security Role.

  3. If they have this Role, they’ll be able to see the button as below

  4. And, if the Role is not assigned, the logged In user won’t be able to see the Button.

  5. See below that in this case, the button will not show up.


JavaScript Code to check assigned Security Roles to the logged in User

  1. Since we are going to use a CustomRule further in the Ribbon Workbench to pick a true or false value based on whether the logged in user has a Security Role or not, let’s write a quick JavaScript function to provision the same.

Tip: Make sure you now pass the PrimaryControl (context) to any JS functions and avoid using Xrm.Page since the same has been deprecated.

// JavaScript source code
contactFormCustomization = {
    checkSubscriptionAccess: function (context) {
        "use strict";
        debugger;
        var currentUserRoles = context._globalContext._userSettings.securityRoles;
        var roleId = "BA69EA1F-A76E-EB11-A812-000D3A1948AB"; // Subscription Manager role
        roleId = roleId.toLowerCase();
        // Get all the roles of the Logged in User.
        
        for (var i = 0; i < currentUserRoles.length; i++) {
            var userRoleId = currentUserRoles[i];
            if (userRoleId == roleId) {
                // Return true if the Role matches
                return true;
            }
        }
        return false;
    }
    
};

Refer this post which discusses a simple JavaScript function to use in order to check if the logged in User has a certain security role or not – https://medium.com/capgemini-microsoft-team/dynamics-365-v9-verify-logged-in-user-security-role-using-typescript-2de52f2ef04e

Explanation

  1. Hard-code the GUID of the Security Role which you are looking to check.
  2. Then read all the Security Roles assigned to the user.
  3. Once the Security Roles are found in the logged in User’s Security Role, return true. Else, return false.

Ribbon Button – Enable Rule

Let’s see how the button customization will look like in XrmToolBox’s Ribbon Customization –

  1. In Ribbon Workbench, you need to add a CustomRule under Enable Rules for the Ribbon button.

  2. Then, it asks for the JavaScript function (mention the function which returns a simple true or false based on above steps). and then mention the library –
    Also, pass the context PrimaryControl and using the same, pick the Security Roles of the logged in user as mentioned in the JS code explanation above.
    I’m naming my Enable Rule as SecurityRoleCheck.

    Now, the CustomRule I’ve applied will call the JS function and is expected to receive either a true or a false based on the code. If false – the button will not be enabled, if true – the button will be enabled.


  3. Now, make sure you add this Enable Rule to the Command (which is in-turn attached to the Ribbon Button itself)

Hope this was helpful. Here are some more XrmTool / Ribbon Button customization related posts you might find helpful –

  1. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  2. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  3. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  4. Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench
  5. Debug Ribbon button customization using Command Checker in Dynamics 365 CE Unified Interface
  6. Show Ribbon button only on record selection in Dynamics CRM
  7. Hide Custom Ribbon Button [Easy Way] – Ribbon Workbench
  8. Enable Flow button on D365 Ribbon
  9. [SOLVED] Navigating URL from Ribbon’s custom button in Dynamics for Phones app
  10. Fix Ribbon icons on the Unified Interface in D365 CE
  11. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD
  12. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox

Thank you!!

Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD

It has always been recommended to enable MFA on environments we work on. For developers, it is especially critical that MFA is enabled that developers are also someone who need to connect the https://www.xrmtoolbox.com/ more than ever!

Here’s one of the common challenges in being able to connect to an MFA enabled Dynamics 365 instance using XrmToolBox.

Register the Dynamics 365 environment as an App in Azure

Microsoft has provided a recommended way to register an App with Azure Active Directory and also the same has been mentioned in the XrmToolBox Connection utility. Below is a summary from the original Microsoft Documentation on the same – https://docs.microsoft.com/en-US/powerapps/developer/data-platform/walkthrough-register-app-azure-active-directory?WT.mc_id=DX-MVP-5003911

  1. Go to https://portal.azure.com/ and look for Azure Active Directory.


  2. Once you save it, you’ll get the Application (client) ID which which will be needed by the XrmToolBox while connecting.

  3. Go to the Manifest file and make “allowPublicClient” to true and Save it.

  4. Now, navigate to API Permissions from the left side menu.

  5. Now, search for the permission “Common Data Service” under the tab APIs for my organization uses.

  6. Make sure Delegated Permissions are selected and tick mark user_impersonation and click on Add permissions.


  7. Select the same and your permissions should look like below. Once this is the state, you are done on Azure side.


    Now, let’s connect XrmToolBox to the Dynamics 365 environment.

Connecting to Dynamics 365 using the XrmToolBox

Let’s see what steps you need to follow in order to connect to the Dynamics 365 instance

  1. Open XrmToolBox and create a New Connection.

  2. Now, since you are aware that the environment is MFA enabled, select MFA/OAuth method.


  3. Enter the URL of the Organization and click Next as shown below.


  4. Now, enter the Application ID which you can copy from the registered App in Azure.

  5. If you click on the “Use development Azure AD App”, the Reply Url will be populated automatically. Before that, you’ll see the message notifying which scenarios this is suitable.

  6. Read below. At this point, I haven’t tried the other method and stuck to the below since I connect XrmToolBox to the Dynamics 365 environment for development purpose.


  7. Once you click OK on the above, the Reply Url will be auto-populated and you can proceed further.

  8. Now, enter the username which you want to connect with. Supposedly, this is the one on which MFA is enabled.

  9. Upon clicking Next, you will be asked the Password of the credentials you are using.

  10. Once you’ve entered the same, it will send a request to your Authenticator on the registered device.


  11. One the device, assuming you have the Authenticator App installed already, you can Approve the same to let the Authentication go through.

  12. Upon Approval, the XrmToolBox will be authenticated and it will be connected to the Dynamics 365 environment. As usual, you can then give it a name and click Finish to save it on your XrmToolBox.





Hope this was helpful!!

Here are some more Azure / Dynamics 365 / XrmToolBox related posts you might want to check out –

  1. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  2. Set Lookups in Xrm.WebApi D365 v9 correctly. Solving ‘Undeclared Property’ error
  3. Understanding Xrm.Page Object ModelForm Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
  4. Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
  5. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  6. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  7. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  8. Call Azure Function from Dynamics 365 CRM using Webhooks
  9. Use Azure App Passwords for MFA enabled D365 authentication from Console App
  10. Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]

Thank you!!

Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365

Most of us have been used to using the classic form designer as of now. And the Power Apps UI which is in https://make.powerapps.com/ has some important new features.

We create forms and we then have to explicitly make sure we have assigned them correct Security Roles and added them to the Apps correctly.

So the new Power Apps Form Designer has a very useful feature called as Form Access Checker. Let’s look at it

A Form & An App

  1. Let’s say we have a custom/Unmanaged Form called as ‘Management Form’.

  2. And an App called as ‘Management App’.

  3. And it has Contact entity with 2 Forms added.

  4. And here are the 2 forms – Contact (OOB) and Management Form (Custom)

Form Access Checker

The Form Access Checker answers 2 questions at once – Let’s look at this feature

  1. Open the form and go to Form Settings.


  2. In the Form Properties, look for Form access checker.


  3. Now, select the Security Role you want to check for and then the App you want to check. The Form Checker will show the Forms which satisfy either and both the criteria.


    Now with only Salesperson role, below are the forms which are applicable. Note that the App is not yet selected.

  4. Now, if you choose the App – the Form that matches both these will be selected.

  5. And it’ll show only the Forms which are applicable to both criteria. (Notice that the form we added in the Management App didn’t show up)

  6. Now, let’s give the Management Form we added Salesperson Security Role and see it satisfy the above criteria. You can now assign Roles to a Form within the Form designer itself.

  7. And if you check again, you’ll be able to conclude that the App we are looking for has both these forms for the Security Role you want to check




Hope this helps. Here are some more Dynamics 365 related posts you might want to check out –

  1. Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
  2. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  3. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  4. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  5. Track and Set Regarding are disabled for Appointments in Dynamics 365 App For Outlook message | Demystified
  6. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  7. Remove ‘This Email has been blocked due to potentially harmful content.’ message in Dynamics 365 Emails | OrgDbSettings utility
  8. Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]
  9. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  10. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]

Thank you!!

Multi-select Items from Gallery and adding/removing them from Collections | Power Platform

Now, let’s say you want to be able to select a few Gallery Items and the same should be populated to a Gallery and even from Collection as well.

You can use this scenario if you want to create a Collection of some GUIDs/Account Names and then take separate action on it or handle it in some other context.

Add Check box in a Gallery

Let’s take a simple example-

  1. I added a Check Box in a simple Gallery list.


  2. Align as per your preference. It also comes with a Default “Option” label which you can remove.


  3. Now, there are 2 properties which you can use to add to a Collection and remove from the same collection.
    Let’s look at the first one – OnCheck


  4. Under OnCheck function, I’ll add the current item to the Collection (A new collection will be created if not already created)
    Blue denotes function used to create a Collection. Collect() function – Microsoft Documentation on the Collect() function – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearcollect?WT.mc_id=DX-MVP-5003911
    Green arrow denotes the name of the Collection I’m creating.
    Red arrow denotes the current Item from the Gallery control and the Account Name field which I want to populate in my collection.
    This will add the Account Name of the record to the Collection once the Check box is checked.


  5. Under OnUncheck function, I’ll add the formula to remove the current Item from the Collection.
    Blue denotes the function used to remove a value from the Collection. Microsoft Documentation of the same is here – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-remove-removeif?WT.mc_id=DX-MVP-5003911
    Green arrow denotes the name of the Collection from which I have to remove the value.
    Red arrow denotes the current Item which I had added to the Collection when the Box was checked. It’ll use the same reference.
    This will Remove the Account Name which was added to the Collection when the checkbox was checked.


    For simplicity, I’m taking Account Names to show in the Collection, you can create a structure in Collection and map Item values as per your needs.

Changes in Collection (Using Data table to visualize)

Just to show/visualize how the Collection will look when I interact with the Check boxes on the Gallery, I’ve added a Data table to keep the demonstration simple.



And populate the Items with the Collection’s Value. Because all the Account Names we added to Collection while marking Check box as Checked will fall under .Value

Working

As you select and unselect items from the Gallery, they are added to and removed from the Collection which is seen in the Data Table below.

Hope this helps!!

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

  1. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  2. Implement character length validation in a Canvas Power App | Power Platform
  3. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  4. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  5. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  6. Debug Published Canvas Power App with other users using Monitor | Power Platform
  7. Download a File from a Canvas Power App using a button | Power Platform
  8. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  9. Logged In User details in a Canvas Power App
  10. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  11. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  12. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App

    Thank you!

Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate

Retrieving OptionSet Labels from CDS data in a Cloud Flow / Power Automate / Flow is an extra step than just picking from the Dynamic Values. Check this post!!

Scenario

While working with data that is either a result of a Dataverse Trigger (on Create/Update) or Action like (Get record, list record), the OptionSet fields from CDS/Dataverse return the Values of the OptionSet instead of the Text Labels –

  1. Let’s say this is the OptionSet in Dynamics

  2. And when you pick the OptionSet field from CDS either from an Action or a Trigger like this
    Let’s say I’m capturing this in a variable to show you


    I’m storing this in a variable for this example to show you

  3. I’ll capture the Value of the OptionSet i.e. the Value part


    Result –

  4. What needs to be displayed is the Label of the OptionSet! Let’s see how we can do this –
    1. Triggers
    2. Actions – List records (Inside Loops)
    3. Actions – Get record (Single record)

triggerOutputs() / triggerBody() to read the OptionSet values from Triggers

Let’s see how to read the OptionSet values from CDS Triggers, Create or Update –

  1. When a Flow is triggered using CDS/Dataverse Triggers (I’m using Common Data Service Environment(Current Environment) trigger), you can read the OptionSet value by using triggerOutputs() / triggerBody() function –
    Here’s a triggerBody() example

    Now, notice that the name of the field is cf_accounttype. So, the label in Triggers can be retrieved as _cf_accounttype_label and NOT cf_accounttype.

    Same way, you can also use triggerBody() function instead as well to yield the same result


    Here’s a post on triggerBody() / triggerOutputs() for your reference – Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

items() to read the OptionSet values from Action Step – List Records (Multiple Records)

Let’s look at this example where you are retrieving multiple records using List Records and now, you apply a loop on each of those to read individual records.

  1. Assuming you are using List Records and you loop through the outputs of each of these records


  2. Now, the value is represented by items() function on the Loop that you are in i.e. Apply to each.
    Hence, the function is
    items('Apply_to_each')?['cf_accounttype@OData.Community.Display.V1.FormattedValue']


    This will show the label of the OptionSet in the results


outputs() to read the OptionSet values from Action Step – Get a record (Single Record)

Similar to items() function, we can use outputs() function to read from the Output’s of the Get a Record Action from Common Data Service (Current Environment)

  1. Get an Account is a ‘Get a record’ Action in CDS/Dataverse Current Environment connector. It’ll only fetch a single record.

  2. Now, let’s look at how outputs() function, similar to items() function used in case of Loops is used.
    Formula is –
    outputs('Get_an_Account')?['body/cf_accounttype@OData.Community.Display.V1.FormattedValue']

    In the above scenario, I’m reading under body hierarchy for cf_accounttype@OData.Community.Display.V1.FormattedValue

Using JSON Parse to get the values

Finally, there’s also a method in which you can create a Parsed JSON from the Outputs

  1. Pick JSON from the Actions, it is under Data Operations connector and is a very popular one.

  2. Now, you’ll need to pass Outputs of the CDS Step to the Inputs of the Parse JSON step. Now, since you don’t already have a schema yet, Just put {} and save (else, you won’t be able to save)

  3. Now, Run the Flow once where the CDS step was successful and copy the Outputs from the Body

  4. Now, go to the same Parse JSON Step and click on Generate from Sample

  5. Now, paste the copied Body to generate the schema.

  6. Once you click OK, the schema will be generated.


  7. Finally, you can select the Parsed schema and use it as Outputs.


    And it will appear as below –


    Again, this will also show the same results as the above approaches.

Hope this helps!

Here are some Power Automate / Cloud Flow posts you might find helpful –

  1. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  2. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  3. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  4. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  5. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  6. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  7. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  8. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  9. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  10. Task Completion reminder using Flow Bot in Microsoft Teams | 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!!

Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform

Although, you can use Text based controls to represent data as is in a Canvas Power App. So why not go an extra mile to make it look more intuitive.

Scenario

Let’s say there are Accounts and you have some kind of Compliance Ratings on them to represent compliant they are based on certain criteria. Could be a Numeric value or Decimal value. But Rating Control represents only in Numeric i.e. Whole Numbers.

So, for this example, I’m using a Rating field which is of type Whole Number in Dynamics 365 on Account entity.

And the complete Dataset looks like this in Dynamics 365 / Dataverse.

Note: I tried with Decimal but it rounded the values hence, sticking to Whole Number.

Rating Control

  1. Let’s say below is the Gallery and you want to show Ratings in the form of stars instead of traditional numeric values.

  2. Now, let’s use Rating Control below the Names of the Accounts to show the Rating values. Select the first Row once you connect to the Common Data Service i.e. CDS / Dataverse Data Source and select the entity you want to populate it with. In this example, we are using Accounts. So my Gallery is populated with Accounts records.
    Select the first record and navigate to Insert tab and look for Input controls as shown below


    Now, look for Rating control.

  3. Once you select Rating, it’ll appear iteratively since it’ll be applied “For Each” of these records in your Gallery control.


  4. I’ve just rearranged them under the name to make them look proper.

  5. Let’s make it Read Only by changing the behavior, so that the Users don’t accidently touch and set a value during Runtime. Although, this won’t affect the actual data but the representation will be incorrect in that case.

  6. Also, the Max will represent the length of your Rating whereas the Default value are kept to 0 in case the field value is not set at Source. (I think 1 would still be misrepresenting)

  7. Now, I’ll connect this Control to the Data Source’s field i.e. Rating field on the Account entity that represents the Rating value.
    On the Default, I’m setting ThisItem.Rating where ThisItem represents the Row of the Account i.e. the Account record itself and Rating is the field in Dynamics 365’s Account entity which we saw in the scenario above.


  8. And that’s it. You can Save and Publish your App and Run it.

Rating values

Now that we’ve added the Rating Control, let’s Run our App and see how it represents the data from your Accounts entity.

And the Ratings represent the below data –

Hope this was useful!

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

  1. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  2. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  3. Debug Published Canvas Power App with other users using Monitor | Power Platform
  4. Download a File from a Canvas Power App using a button | Power Platform
  5. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  6. Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
  7. Implement character length validation in a Canvas Power App | Power Platform
  8. Log Canvas Power App telemetry data in Azure Application Insights | Power Apps
  9. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  10. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  11. Dependent OptionSets in a Canvas Power App for 1:N related CDS entities | Power Platform
  12. Restore older version of a Canvas Power App | Power Platform

Thank you!!

Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate

Let’s take a simple use case where you need to have a Microsoft Team created in Teams and have the Project Members added to the Microsoft Teams’ Project Team.

You can simply do this using 2 simple Flows in Power Automate

Scenario & Setup

If you are a PSA Customer, you would want to create a Team in Microsoft Teams based on what Project it is and then add Team Members of the Project as Team Members in the Microsoft Teams’ Team you created.

Let’s look at a Simple example of how you can do this. And further, you can enhance the implementation yourselves based on whether a Project becomes Inactive, or someone is to be removed from the Project Team.

I’ll be creating 2 Flows for this purpose –

  1. One that will create a Team in Microsoft Teams upon Project Creation and
  2. Other, will add Member to the Project’s MS Team upon addition of the Team Member in Project in PSA/Project Operations.

Create a Team for the Project

Let’s look at the first scenario where you can create a Team in Microsoft Teams once create a Project in PSA.

  1. Flow to trigger off of a creation of a Project.
    |
  2. Now, search for create a team in the next step to find a Microsoft Teams connector’s Action to create a Team in Microsoft Teams.


  3. Assign the Name of the Project and Description of the Project for easy understanding. You can make the team Private which is ideal to keep users’ Teams cleaner and also keeps Project discussions isolated if that’s the need.


  4. Once a Team is created, I’ve created a field on Project record to hold the MS Teams’ ID for other references.

    Add a step to update the Project back with the created MS Teams’ ID like this

    And in that, I’ll update the Created Team’s ID

  5. Now, fetch the Project Manager’s User record in CDS (PSA, basically) so that the User’s ID can be used to make the Owner of the Team you are creating.

  6. Next, you need to add Members to the Team. Look for add a member to the team and you’ll find Microsoft Teams’ action which you can use.

  7. Here’s how the Add a team member looks like.

  8. Now, this is a little tricky. Since you don’t get the Dynamic Values right away in this Action, click on Add a custom item.

  9. In Add a custom item, you can add the Team ID of the MS Team you just created for the Project in step #3 above.

    Once you add it, it’ll look like below

  10. And for the User’s AAD ID step, set the System User’s (fetched in #5)

    Add Azure AD Object ID

  11. Now, the last step looks set.

Add Members to the Project Team

Let’s work on the other scenario with other Flow. This will be on trigger of a creation of a project Team Member.

  1. This second will fire off on creation of a Project Team Member. Hence, the trigger on Create of a Project Team Member.

  2. I’ll get the Project record since I need the MS Teams ID which is a custom field we created to store the MS Team’s ID on the Project.

    Again, you can do this easily if you know how to get related records. I’ve done an extra step for simplicity.


  3. Now, the next step is to retrieve the Bookable Resource‘s Record. In turn, we’ll retrieve the System User record associated with the Bookable Resource record on the Project Team so that the System User’s ID can be used.
    Just because I need the Azure AD Object ID (User) entity, I’ve written a fetch XML on the Bookable Resource entity to go and get the User record’s Azure AD Object ID. I’ll need this to map it in the step where we’ll add the Member to the Project’s created Team.


    My step to retrieve Bookable Resource + System User’s Azure AD ID looks as below. Make sure you select the Bookable Resource GUID reference from the trigger i.e. the Creation of the Project Team Member record to ensure we only get 1 record.

  4. Then, I’ll simply generate a Parsed JSON after the above Step so that I can get to select the required attribute to select in the Team’s Add a Team Member step (Because the related field is not available for Dynamic Values) (In case you know how to directly write using outputs() function, that should be good enough too!!)


  5. Now, add the Team Member to the Project’s Team in MS team. Again, as mentioned above in the previous Flow, use the Add a member to a team Action from Microsoft Teams connector to do so.
    Now, add the Team’s ID in the Team field.

    On the Team field, you’ll need to Add a custom Value like we did in the previous Flow.



  6. And for the final step, in the User AAD ID for the user to add to a team step, you can pick the parsed Azure ID field from #4 above.

  7. As soon as you select from Parse, the Flow step will be converted to Apply to each. But that’s because we used List records which returns multiple values. Even though Apply to each is applied, this will logically run only once anyway!!

  8. Now in the user AAD

Working

Now’s let’s see all this in action.

  1. Let’s create a Project in PSA. Notice I’ll enter the name and the Description since we are creating a Team in MS Teams and that’s what we are filling out. Notice that MS Teams Project ID is blank. Our Flow will populate that once a Team is created in Microsoft Teams.
    Notice that Joe Danny is the Project Manager on the Project, he will be the Owner of the Team we are creating in MS Teams as per our first Flow.


  2. A Team like this will be created in Microsoft Teams.

  3. Also, notice that in the Project in PSA, a MS Teams Project ID will be populated too.

  4. Also, notice that Joe Danny is the Owner of the Team since Joe is the PM on the Project.

  5. Now, let’s add 1 more Team Members to the Project in PSA. Now, I’ve added a new Team Member Priyesh in the Project’s Team.


  6. That team member also get added as Members in Microsoft Teams in the Project’s Team. This is from out second Flow we created to add the Team Members to the created Teams for a PSA Project.


Here are some more enrichments you’ll need to do to handle some scenarios –

  1. Separately handle if a Project is Canceled/Deactivated for some reason.
  2. Remove Members from an MS Teams if they are removed from the Project.

Hope this was useful.

Here are some more posts about Project Service Automation (PSA) in Dynamics 365 / Microsoft Teams that might be helpful –

  1. Cancelled Bookings Imported in Time Entries in Dynamics 365 PSA issue | [Quick Tip]
  2. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  3. Change Booking Status colors on Schedule Board for Field Service/PSA [Quick Tip]
  4. Additional columns in PSA v3 Schedule view
  5. Check Managed Solution failures in Solution History in Dynamics 365 CRM
  6. Modify Project tab’s view in Schedule Board in PSA v3 | Quick Tip
  7. Update Price feature in D365 PSA v3
  8. A manager is required for non-project time entries, absence, and vacation error 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!!

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.