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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with the date for...
Power Automate
Answered

Help with the date format in Power Automate

(0) ShareShare
ReportReport
Posted on by 45

Hi,

I am new to power automate and struggling with the date format. I am trying to get the data from Power BI to CSV and save it on the SharePoint site. Please see the flow below:

apanta_0-1689313722224.png

 


The flow is working fine but my problem is on the extracted CSV file. The date is coming up on the long date format instead of the short format. In power BI, the date is in short date format but I am not sure why it is appearing like this on my extracted file. Is there something that I can do to fix this?

apanta_3-1688536558946.png


Also, with the file name, as I am using time stamp, can we do it in short date format as well? For example, in below picture, when the flow runs at 1st of every month (for example August), can we get name as "Testing New File July 2023"?

apanta_4-1688536770656.png


Any help would be greatly appreciated.

Thank you!

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Try using the formatDateTime() expression to format it according to the format you need. See here for reference: https://learn.microsoft.com/en-us/troubleshoot/power-platform/power-automate/how-to-customize-or-format-date-and-time-values-in-flow

     

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution.

    If you like my response, please give it a Thumbs Up.

     

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • apanta Profile Picture
    45 on at

    Hi Agnius,

    Sorry, I might sound silly, but how do I add it for the specific column?

    apanta_0-1688537634236.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    When you've typed in formatDateTime(, you can click on the Dynamic content tab again and select the item you want, like you would normally.

  • apanta Profile Picture
    45 on at

    Thanks for your reply, Angus!

    But I can't see that column when I go back to dynamic content. Please see the below screenshot:

    apanta_0-1688538340428.png

     

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Try using formatDateTime(item()?['ColumnName'],'yyyy-MM-dd'))

    Note you will need to replace ColumnName in there with an actual name of what you are trying to select from your dataset.

     

  • apanta Profile Picture
    45 on at

    It worked.

    Thank you so much 😊

  • apanta Profile Picture
    45 on at

    Hi Agnius,

    I am back again with the problem. The solution you provided worked well with the first date column. Since I have three date columns in my Power BI which I need as well, I tried to do same for rest of the two but the flow stopped working. I used the same formula but it didn't work for others. When I remove this formula from those two columns, it works fine but as soon as I put back the formula, my flow starts having some issue. Do you know if we can use this dateformattime function in only one column? Not sure why it's not working for other date columns.

    Thanks!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    No, you can use it on any date column. In order to help you more, I would need to see the error that it throws.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution.
    If you like my response, please give it a Thumbs Up.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

  • apanta Profile Picture
    45 on at

    Below is the error message:

    The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{
    "Ticket ID": "@item()?['Id']",
    "Requestor Name": "@item()?['Requestor Name']",
    "Requestor Date": "@formatDateTime(item()?['Requestor Date'],'dd-MMM-yy')",
    "Priority": "@item()?['Priority']",
    "Department": "@item()?['Department']",
    "Status": "@item()?['Status']",
    "Assigend Name": "@item()?['Assigned Name']",
    "Short Description of the Issue": "@item()?['Short Description of the Issue']",
    "Description of the Issue": "@item()?['Short Description of the Issue']",
    "Facility": "@item()?['Facility']",
    "Wing or Area": "@item()?['Wing or Area']",
    "Level or Floor": "@item()?['Level or Floor']",
    "Room Number/Name": "@item()?['RoomNumber/Name']",
    "Target Completion Date": "@formatDateTime(item()?['Target Completion Date'],'dd-MMM-yy')",
    "Completed Date": "@formatDateTime(item()?['Completed Date'],'dd-MMM-yy')",
    "Completed By": "@item()?['Completed By']",
    "Internal Notes": "@item()?['Internal Notes']"
    }' failed: '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.'.

  • apanta Profile Picture
    45 on at

    is this happening because the "Completed Date" column has few null values?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 410

#2
Vish WR Profile Picture

Vish WR 289

#3
David_MA Profile Picture

David_MA 282 Super User 2026 Season 1

Last 30 days Overall leaderboard