Sunday, April 24, 2022

Power Automate: How to format a date column in Create HTML Table

I had recently written a post on how to populate the lookup value instead of the GUID in Power Automate. You can refer to the same blog post by clicking here.

I had formatted the Created On field too using the same steps as mentioned in that post.

Unit next time!

Wednesday, April 20, 2022

Power Automate: How to add a space between words in header row of Create HTML Table action

 When you add Create HTML Table action step in Power Automate , you can select to add custom columns as headers. When you enter the column names, you will notice that you cannot add a space as shown below. Strange but true.


Even if you go into Peek Code section of the step, you cannot edit it there.

After spending sometime looking for it on the internet, I found that you need to enter a special character that represents a space character. Here are the 2 steps:

  • Place the cursor between Created & On.
  • Ensure that your NumLock is switch on.
  • Hold down the Alt key and enter 32 using the numpad on your keyboard.
  • That will add a space between the 2 words.

I know, I hear you sigh :)

Unit next time!

Sunday, April 17, 2022

Power Automate: How to get the value of a lookup column in Create HTML Table action

In the below table, I wanted to show the name of the Owner. But if you add the Owner (Value) column directly using dynamic content, you know that it shows the GUID instead of the name. So here is what you need to do.

HTML Output using Power Automate

You need to enter the content as an expression and append the value @OData.Community.Display.V1.FormattedValue after the column name. Here is how the expression will look (without the " quotes) "item()?['_ownerid_value@OData.Community.Display.V1.FormattedValue']", and the value is going to look like a function as shown below.

Create HTML Table action step in Power Automate

So, the question is how do you build this expression for the Owner column or any other field (column) in Dynamics 365 CE (Customer Engagement)?

  • Let the Owner (Value) Dynamic content be selected.
  • Click the 3 dots next to Create HTML Table.
  • Select Peek Code.
  • You'll see the value as item()?['_<FieldName>_value']
Note: The <FieldName> may be any lookup field name too.

Lookup value using Power Automate
  • Copy this value in a notepad.
  • Append the value as mentioned above so the whole value looks item()?['_<FieldName>_value@OData.Community.Display.V1.FormattedValue']
  • Copy this in the Expression section and click OK.
Note: This works if the you're using a Dataverse connector. It doesn't work if your connector is Dynamics 365 connector. This happened to me. I was using the List records (Dynamics 365) connector and how much ever I tried the above expression, it still would show the GUID. I then changed the connector to Dataverse and used the List rows (Dataverse) action step instead to fetch the records, and the same expression worked.

Until next time!