Hello,
I created a flow with a set of multi level approvers. The date/time stamp is added to the following approvers email but the formatting is off after my first approver. How can I get the date/time format to look as the first one?
Thank you in advance!
Solved! Go to Solution.
Hi @knandez05
This is connector limitation - it's impossible to change date format in email generated by the approval connector itself.
https://docs.microsoft.com/en-us/connectors/approvals/
If you would like this Date in other format in Microsoft Flow, please submit an idea to Flow Ideas Forum:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
For now, a work around is to use send an email (V2) connector with a new forwat date from Composer.
Otherwise, Teams approval app shows a better date format.
Thanks
Hello,
Please try to use expression "formatDateTime" to format the datetime.
For more details:
In this scenario, you may try to create a flow and configure the code to format the datetime using the following function:
formatDateTime(body('Start_an_approval')?['responseDate'],'MMMM dd,yyyy hh:mm tt')
If I have answered your question, please mark your post as Solved.
Thank you.
Thanks for your response @tingtingluo. This is all very new to me and I need a little bit more direction.
The function/expression you provided, would I create a Compose action with this expression or do I use this in place of where the date should be in the approval email?
I have several approval emails throughout my workflow.
Hi @knandez05
Thanks for the instant reply.
The Compose action is like a static variable. It can be placed anywhere within your flow, and its value can be accessed from anywhere within the flow. The value is persistent – once it is set it cannot be changed.
It's convenient to convert the format of several Date fields. To make the Compose card easier to find later, rename it by selecting the text Compose on the title bar of the card and entering a name that's easy to remember.
https://docs.microsoft.com/en-us/power-automate/data-operations#use-the-compose-action
https://www.powerautomatetraining.co.uk/post/the-compose-action
Best Regards,
Thank you When I try to add to my flow, I get the following errors when saving.
The template validation failed: 'The action(s) 'Start_an_approval' referenced by 'inputs' in action 'Compose_4' are not defined in the template.'
Correct to include a valid reference to 'Start_an_approval' for the input parameter(s) of action 'Compose_4'.
Hi @knandez05
I suddenly realized that there are some differences between Create an Approval vs. Start and Wait for an Approval acion. For the second one, when I try to select the Dynamic content for an expression, the list of available options has already reduced down to only:
Approval ID
Body
Completion Date
Details
Item Link
Item Link Description
Outcome
Request Date
Response Summary
Title
Inspired by the article here: https://tomriha.com/avoid-apply-to-each-after-single-approval-response-in-power-automate/
1. Using the ‘Apply to each’ action to process each of the Responses object in the approval out array.
2. Add the 1st compose action, select 'Responses Response date' from Dynamic content list. And rename the action to 'Respons Date Time'.
3. Add the 2nd compose action.
Expression :
formatDateTime(outputs('Response_Date_Time'),'MMMM dd,yyyy hh:mm tt')
The first parameter outputs('Response_Date_Time') should be the Output of the prior Compose action, which was renamed to"Response Date Time"
Result:
I hope this resolves the issue for you.
Thank you.
@tingtingluo Thanks for the additional input. I followed the steps you provided but it seems that it is still not working.
formatDateTime(outputs('Response_Date_Time'),'MMMM dd,yyyy hh:mm tt')
Hi @knandez05
This is connector limitation - it's impossible to change date format in email generated by the approval connector itself.
https://docs.microsoft.com/en-us/connectors/approvals/
If you would like this Date in other format in Microsoft Flow, please submit an idea to Flow Ideas Forum:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
For now, a work around is to use send an email (V2) connector with a new forwat date from Composer.
Otherwise, Teams approval app shows a better date format.
Thanks
formatDateTime(outputs('Start_and_wait_for_an_approval')?['body/completionDate'], 'dd/MM/yyyy hh:mm tt')
User | Count |
---|---|
6 | |
5 | |
3 | |
3 | |
2 |