Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Converting datetime from ISO 8601 format to dd/MM/yyyy

Like (0) ShareShare
ReportReport
Posted on 26 Jun 2024 21:51:14 by 109

Hi

 

I have a Power Automate visual in Power BI that exports a CSV with field (that can include nulls) in ISO 8601 format (eg: 2024-07-03T14:00:00.000Z) that I would like to convert to dd/MM/yyyy.

I've tried several variations of the expression below, but keeps returning nulls, not sure what I am doing wrong?

 

if(empty(item()?['_Table[Datefield]']),null,formatDateTime(item()?['_Table[Datefield]'],'dd/MM/yyyy'))


This is my flow with the expression in the compose step;

 

Ry009__0-1719438036662.png



And 'Outputs' from the Compose in the Append to array variable step

Ry009__1-1719438219713.png

 

 

  • Verified answer
    Ry009_ Profile Picture
    109 on 27 Jun 2024 at 23:26:32
    Re: Converting datetime from ISO 8601 format to dd/MM/yyyy

    I realized what I was doing wrong, I was referering the field as if I was using 'Run query against a dataset', rather than referencing the table array. 

    I also didn't bother with the compose as I had previously, and instead simply did the expression in the 'append to array variable' step.

    Only problem is now I need to convert the date to local and not UTC, I'm not sure how to wrap it with the right timezone? (Aus Eastern Standard Time)

    EDIT; Figured it out


    Instead of 

    if(empty(item()?['DateFieldfromTableArray']),'',formatDateTime(item()?['DateFieldfromTableArray'],'dd/MM/yyyy'))

     
    Amended it to 

    if(empty(item()?['DateFieldfromTableArray']),'',convertTimeZone(item()?['DateFieldfromTableArray'],'UTC','AUS Eastern Standard Time','dd/MM/yyyy'))
  • Ry009_ Profile Picture
    109 on 27 Jun 2024 at 08:07:13
    Re: Converting datetime from ISO 8601 format to dd/MM/yyyy

    Yeah.....not sure why? I've tested on a single row that isn't null for the field.

  • v-yetonggu-msft Profile Picture
    on 27 Jun 2024 at 03:20:21
    Re: Converting datetime from ISO 8601 format to dd/MM/yyyy

    Hi @Ry009_ ,

    Is your array output empty too?

     

    Best Regards,

    Sunshine Gu

  • Ry009_ Profile Picture
    109 on 27 Jun 2024 at 02:40:44
    Re: Converting datetime from ISO 8601 format to dd/MM/yyyy

    Thanks for the response and suggestion. Unfortunately nulls on the output 😞

  • v-yetonggu-msft Profile Picture
    on 27 Jun 2024 at 00:29:59
    Re: Converting datetime from ISO 8601 format to dd/MM/yyyy

    Hi @Ry009_ ,

    Please try this expression:

     

    if(empty(item()?['_Table[Datefield]']),'',formatDateTime(item()?['_Table[Datefield]'],'dd/MM/yyyy'))

    If it still returns a null value, could you please show me a screenshot of your overall output _Table [Datefield] array?

     

    Best Regards,

    Sunshine Gu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 87

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started