Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
CSJ123
Frequent Visitor

Using Power Automate button in reports - Date Format error

Hi,

 

Wondering if someone can help me with this...

I have added a power automate button to my report, and set up a flow to update a row in an excel table. All is working well, but the date format is coming through as "YYYY-MM-ddT21:00:00.000Z", instead of, "dd/MM/yyyy".

Instead of the dynamic content, I tried using the expression: formatDateTime(item()?['Table[Column]'], 'dd/mm/yyyy') but I then got an error relating to null values (possibly some empty rows in data).

I tried: "if(empty(item()?['TableName[Column]']),'null',formatDateTime(item()?['TableName[Column]'], 'dd/MM/yyyy'))" - but all the dates then came out as null (so presuming there is an error in this expression?!!). 

Any help is greatly appreciated I am not very familiar with Power Automate.
Thanks 

1 ACCEPTED SOLUTION

Try putting the action in a "condition" step, where the condition is IsBlank(your field here), then for the equals enter false (just the word false on its own, lowercase). That way it will only do the action if it's not blank. 

 

If IsBlank doesn't do it, you can also try IsEmpty(field name) or just put the field in the condition and check if it is equal to null. Depending on how blank your blanks are any of those could work. 🙂

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Don't try to fight that. Power Automate is by default using ISO8601 datetime formats.  So the data is coming across in the correct format.

Thanks for replying!
I do get that this is the correct format for the data... but our accounts department doesn't want to work with the date in ISO8601 format. They simply need a short date (uk so dd/MM/yy), when an excel table is updated from a powerbi report using the flow button. Can you suggest an expression that will allow for formatting in this way, taking into account the whole "null" issue. I have checked the report data, and there are no blank/null rows that I can see.

  • Flow ran fine with ISO8601 format.
  • Expression: formatDateTime(item()?['Append2[Start Date]'],'dd/mm/yy') - resulted in Flow Failed, a "One or more fields provided is of type 'Null', a different type is expected" error.
  • Expression: if(empty(item()?['Append2[Start Date]']),null,formatDateTime(item()?['Append2[Start Date]'],'dd/MM/yyyy')) - flow successful but resulted in every Start Date field being populated by "null"  in excel.

    Any help greatly appreciated!! 😊

Try putting the action in a "condition" step, where the condition is IsBlank(your field here), then for the equals enter false (just the word false on its own, lowercase). That way it will only do the action if it's not blank. 

 

If IsBlank doesn't do it, you can also try IsEmpty(field name) or just put the field in the condition and check if it is equal to null. Depending on how blank your blanks are any of those could work. 🙂

That's great Christine. Thanks so much for your help!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.