web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting datetime fr...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on 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

 

 

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    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

  • Ry009_ Profile Picture
    109 on at

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

  • v-yetonggu-msft Profile Picture
    on at

    Hi @Ry009_ ï¼Œ

    Is your array output empty too?

     

    Best Regards,

    Sunshine Gu

  • Ry009_ Profile Picture
    109 on at

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

  • Verified answer
    Ry009_ Profile Picture
    109 on at

    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'))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard