cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trini272021
Helper I
Helper I

Readable Time

Hello,

 

How would I convert the following into a more readable time?

 

concat('ApproverName: ',item()?['responder']?['displayName'],' ResponseDate: ',item()?['responseDate'],' Comment: ',item()?['comments'],'</br>',variables('AllResponses'))
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @trini272021 

 

The problem we have with the formatDateTime() is that the date comes from the approval as a string, so you may need to split it and rearrange it to the correct format to use it as a valid DateTime string. 

If you want to know a little more about the ISO 8601 format check out the following thread.

 

Moving on, I made a work around for your problem using the action "append to string variable". 

AnthonyAmador_0-1623950816113.png

formatDateTime(outputs('Start_and_wait_for_an_approval')?['body/completionDate'], 'dd/MM/yyyy HH:mm:ss')

 

Hope this can help you, any questions let me know. 

Cheers.

 

View solution in original post

7 REPLIES 7
AnthonyAmador
Community Support
Community Support

Hi @trini272021 

 

What you want to do is change the format of "ResponseDate" to another format? In what kind of format do you get the "ResponseDate"?

For example, this option can help.

 

formatDateTime('2020-02-05T10:10:00Z','yyyy-MM-dd')

 

will return

 

2020-02-05

 

This documentation could help you, let me know if you have any questions.

How to customize or format Date and Time values in a flow - Power Automate | Microsoft Docs

Hello,

 

The format I get is: 

  • 2009-06-15T13:45:30Z

 

How do I incorporate the conversion in my string?

AnthonyAmador
Community Support
Community Support

Select the tab Expression and write  "formatDateTime('ResponseDate','yyyy-MM-dd')" 

 

AnthonyAmador_1-1623782456258.png

 

Let me know if that helps. 

Cheers. 

 

Hi,

 

So to keep everything else in my string I tried the following but it didn't work:

 

concat('ApproverName: ',item()?['responder']?['displayName'],' formatDateTime('ResponseDate','yyyy-MM-dd')',item()?['responseDate'],' Comment: ',item()?['comments'],'</br>',variables('AllResponses'))

AnthonyAmador
Community Support
Community Support

Can you share a screenshot of your flow?

 

 

concat('ApproverName: ',item()?['responder']?['displayName'],' ResponseDate: ',item()?['responseDate'],' Comment: ',item()?['comments'],'</br>',variables('AllResponses'))

 

1.jpg

 

Here is where I got the example from - https://powerusers.microsoft.com/t5/Building-Flows/Approvals-Multiple-Approvers-How-to-capture-all-t...

 

Hi @trini272021 

 

The problem we have with the formatDateTime() is that the date comes from the approval as a string, so you may need to split it and rearrange it to the correct format to use it as a valid DateTime string. 

If you want to know a little more about the ISO 8601 format check out the following thread.

 

Moving on, I made a work around for your problem using the action "append to string variable". 

AnthonyAmador_0-1623950816113.png

formatDateTime(outputs('Start_and_wait_for_an_approval')?['body/completionDate'], 'dd/MM/yyyy HH:mm:ss')

 

Hope this can help you, any questions let me know. 

Cheers.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,276)