Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Converting Date from Run Query against Dataset from ISO 8601 to 'DD/MM/YYYY'

(0) ShareShare
ReportReport
Posted on by 8

I have a flow that runs a query against a database and puts it into a CSV table

The date in the query returns in the ISO 8601 format (e.g. 2023-10-11T00:00:00), but I need it to have dd/mm/yyyy

the select portion is just to rename column headers as i need the space between words, and no square brackets. 
I used this expression item()?[Column Header]. Tried to wrap a format time around this but it didnt work

 

ADDLarter_1-1695101535326.png

 

  • ADDLarter Profile Picture
    8 on at
    Re: Converting Date from Run Query against Dataset from ISO 8601 to 'DD/MM/YYYY'

    This returned Blank
    a bit more context
    My output looks like this:

    ADDLarter_0-1695166333914.png

    my dax query i run is:

    DEFINE
     VAR __DS0FilterTable =
     FILTER (
     ALL('Combined CACSTOREADVICE'),
     'Combined CACSTOREADVICE'[Start Date] >= TODAY() &&
     'Combined CACSTOREADVICE'[Start Date] < TODAY() + 7
     )
     
     VAR __ColumnsToSelect =
     SELECTCOLUMNS (
    SUMMARIZE( 
     __DS0FilterTable,
     'Combined CACSTOREADVICE'[Start Date]
     ),
     "Start Date", 'Combined CACSTOREADVICE'[Start Date]
     )
    
     VAR __FilteredColumns =
    FILTER (
     __ColumnsToSelect,
    NOT ( ISBLANK ([Start Date] ) )
     )
    
    EVALUATE
     __FilteredColumns

     

    After this I have to rename the columns:
    using the item()?['Combined CACSTOREADVICE[Start Date]']

  • v-xiaochen-msft Profile Picture
    on at
    Re: Converting Date from Run Query against Dataset from ISO 8601 to 'DD/MM/YYYY'

    Hi @ADDLarter ,

     

    Try this:

    if(equals(item()?['Column Header'],null),'',formatDateTime(item()?['Column Header'],'dd/MM/yyyy'))
     
    Best Regards,
    Wearsky
  • ADDLarter Profile Picture
    8 on at
    Re: Converting Date from Run Query against Dataset from ISO 8601 to 'DD/MM/YYYY'

    Unfortunately it doesn't work, I get this:

     'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

  • v-xiaochen-msft Profile Picture
    on at
    Re: Converting Date from Run Query against Dataset from ISO 8601 to 'DD/MM/YYYY'

    Hi @ADDLarter ,

     

    Please try this 

    formatDateTime(item()?['Column Header'],'dd/MM/yyyy')
     
    Best Regards,
    Wearsky

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >