by Priyesh Wagh | Mar 16, 2021 | Dynamics 365, Microsoft, Technology
As Power Automate becomes more of a norm to make Microsoft Teams in a channel, tagging a user is one of the most frequent and obvious asks for Power Automate / Flow developer.
Here’s how you can take a User from Office 365 to a Teams channel.
Let’s look at these straight-forward steps! It’s easy.
Getting a Mention Token
First, let’s create a Mention token. Let’s see how –
- In Microsoft Teams connector in Power Automate, look for Get @mention token for a user (preview)

- This Action step asks for a User Principal (If you are using an Active Directory) or a User ID which needs to be tagged/mentioned.

- Let’s enter an User Principal or User ID here. I’m hardcoding this for visibility, your scenario would vary.
Use Token in a Post to Teams
There are different ways to Post a message to Teams. Let’s see the options.
- Below are some options to post a message to Teams

- Let’s go with Post a message (v3) (preview) for this example to post a message to Teams.

- Finally here’s how your step would end up looking with the Mention tag added in the message to be posted in ex: Open Board Meetings Teams’ General Channel.

Post in Teams
So here’s how the post will look once the Flow is run and the message is posted to Teams

Hope this was helpful! Here are some more Power Automate / Flow posts you might want to check out –
- Converting JSON to XML and XML to JSON in a Flow | Power Automate
- Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
- Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
- Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
- Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
- Import multiple Users in Office 365
- Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
- Turn Teams On / Off at Org Level, provisioning users | M365 Admin Center Tip
- FormatDateTime function in a Flow | Power Automate
- Approval Process using Power Automate
Thank you!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
by Priyesh Wagh | Mar 15, 2021 | Dynamics 365, Microsoft, Technology
In one of my previous posts, I had highlighted, you can enable a Rich-Text Control for a Multiple-Line of Text type of field. Here it is again – Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
In the above post, I had highlighted that we can change the control of a Model-Driven control of Text to Rich-Text and make it appear as below

Now, reading the same field in a Canvas App will make it appear as below

Now, let’s see how we can overcome this and read the correct Rich-Text Control formatting in the Canvas App’s Form as well.
Canvas App Form
Let’s look at the changes you’ll need to do to the Gallery control in order to read the Rich-text formatting as seen in the Model-Driven App
- Select the Gallery itself and expand the Fields section and locate the field which is a Rich-Text control in the Model-Driven app itself.

- Now, change the Control type and select the Edit rich text control from the options.
- Once this is selected, the Control will be updated to read formatting as in the Model-Driven app itself.

Hope this was helpful. Here are some more Power Apps / Power Platform posts you might want to check –
- Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
- Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
- Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
- Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
- Debug Published Canvas Power App with other users using Monitor | Power Platform
- Download a File from a Canvas Power App using a button | Power Platform
- AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
- Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform
- Implement character length validation in a Canvas Power App | Power Platform
- Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
Thank you!!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
by Priyesh Wagh | Mar 7, 2021 | Dynamics 365, Microsoft, Technology
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.
- 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.

- If I format the same data in JSON formatter online, it’ll look like this –
- 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.
- The result of the same is as below

- And if we take it to an XML formatter, it’ll look like below

Let’s look at what won’t work
- 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…“

- 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 –
- 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.
- The result is as follows –

- 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 –
- JSON – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#xml?WT.mc_id=DX-MVP-5003911
- 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 –
- Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
- Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
- FormatDateTime function in a Flow | Power Automate
- Formatting Approvals’ Details in Cloud Flows | Power Automate
- InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
- Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
- Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
- Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
- Make On-Demand Flow to show up in Dynamics 365 | Power Automate
- Run As context in CDS (Current Environment) Flow Trigger | Power Automate
Thanks!!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
by Priyesh Wagh | Mar 3, 2021 | Dynamics 365, Microsoft, Technology
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.
- 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

- Now, Amit is also part of a Sales Team which is an Owner Team in Dynamics 365 CRM/CE
- 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

- 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 –
- I’ve created a new view called as My Team(s) Contacts. And I’ll start by editing the criteria itself.

- 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.

- 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.

- Once you select the Users, expand the dropdown under Users which will be the fields of the System User record itself.
- 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.

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

- 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 –
- 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]
- Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
- Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
- Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD
- Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365
- Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip
- Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
- Make On-Demand Flow to show up in Dynamics 365 | Power Automate
- Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
- Remove ‘This Email has been blocked due to potentially harmful content.’ message in Dynamics 365 Emails | OrgDbSettings utility
Thank you!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
by Priyesh Wagh | Feb 28, 2021 | Dynamics 365, Microsoft, Technology
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
- 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.
- 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.

- 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.
- 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

- 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!

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

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

- 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 –
- Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
- FormatDateTime function in a Flow | Power Automate
- Formatting Approvals’ Details in Cloud Flows | Power Automate
- Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
- Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
- InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
- Store ‘Today’s Date’ in a field to use in workflow conditions in D365 CE
- Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
- Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
- Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
- Run As context in CDS (Current Environment) Flow Trigger | Power Automate
- Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
Thank you!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
by Priyesh Wagh | Feb 22, 2021 | Dynamics 365, Microsoft, Technology
Office 365 Outlook connector is one of the most required connectors for Cloud Flows since it involves Exchange Online / Outlook services.
At times, all the Connection References work fine elsewhere but in causes issues with Office 365 Outlook and shows error which says ‘Connection not found. Please create a new connection and change your application to use the new connection‘ even when you were able to authentication successfully with/without MFA being enabled.
What could be wrong? See below.
Error for Office 365 Outlook
In Power Automate / Cloud Flow, if you may face this error especially in the Office 365 Outlook connector and using Actions for the same.
- For example, I want to use Send Email (V2) Action from the Office 365 Outlook connector, but I see the below error.
- If you check for the Connection Reference it is using, even though the credentials are correct and you’ve correctly re-authenticated it several times, it shows as an Invalid Connection

Resolution
Here’s why this issue occurred –
- Go to the User who you are using as a Connection Reference in your Cloud Flow. Look if a Mailbox exists for the user.
- Now, assign the User a license which will create a Mailbox / re-assign a license which has Mailbox/Exchange Online service present in it.
Here’s Microsoft Documentation on which all licenses provide Exchange Online which must be assigned to a User: https://docs.microsoft.com/en-us/office365/servicedescriptions/exchange-online-service-description/exchange-online-service-description?WT.mc_id=DX-MVP-5003911
In my example: I use E3, so I’ll assign the same. Depending on your scenario, you must assign a license which has Exchange Online plan on it

- Check for Exchange Online service and it should be enabled/selected.

- Once a license is assigned, it takes a few minutes for provisioning to complete.

- Now, if you try to correct the Invalid connection, it will be accepted and you’ll see this

Hope this helps!
Here are some more Power Automate / Cloud Flows posts you might want to check –
- Formatting Approvals’ Details in Cloud Flows | Power Automate
- Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
- FormatDateTime function in a Flow | Power Automate
- Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
- Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
- InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
- Parallel Branching in Cloud Flows – Isolate Response dependent Step Actions in parallel branches | Quick Tip
- Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
- Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
- Make On-Demand Flow to show up in Dynamics 365 | Power Automate
Thank you!!
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
Recent Comments