Hi
I have looked through a number of posts on this and tried a lot of what I found but cannot find what I am looking for.
I have created a form and the date in the form shows as dd-mm-yyyy but when I put the response into a power automate flow it changes the format to yyyy-mm-dd and any changes I make fail as I get a message saying it must be ISO8601 compliant.
Does anyone out there know how I can format the date so it is displayed as dd-mm-yyyy
Any help would be really appreciated.
Solved! Go to Solution.
Hi @Metamorph
Please note that in the picture below, there are two Composes and write the formula in Compose 2.
Best Regards.
Hey @Metamorph
You can use the expression -
formatDateTime(triggerBody()?['Date'],'dd/MM/yyyy')
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hi @CFernandes
Thanks for the quick reply. I am new to doing this, but I cannot see the full expression and would this step be after get response details?
Thank you
Sorry got string in an email. I have tried that and I got
Unable to process template language expressions in action 'Compose' inputs at line '1' and column '15952': '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.'.
@Metamorph It seems that the value returned by your variable is null.
Can you add a compose > add the variable and see if it returns correct value?
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
I tried that and I got the following
Hey Mate @Metamorph
Your date Time item is not set.
Please Fill in the form again make sure your Date Time field is filled and then run your flow and you will see the existing value.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.
Hi
I completed the form again and filled in every field on it but the flow has still failed with the same error. ☹️
Hi @Metamorph
Please take a try refer to the screenshot below.
Expression:formatDateTime(outputs('Compose'),'dd-MM-yyyy')
Result:
Hope the content above may help you.
Best Regards
If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi
I tried that and got:
Hi @Metamorph
Please note that in the picture below, there are two Composes and write the formula in Compose 2.
Best Regards.
Yes that worked, thanks so much. If I have more than one date I need to convert do I have to create 2 compose steps for each date or can it be done within the 2 steps you advised to create?
Thanks again
Hi @Metamorph
You can combine two steps into one step.
First. Delete outputs('Compose')
Then click Dynamic content.
Then select the response which you want.
Finally click update.
Compose can be deleted and only Compose 2 is retained.
Best Regards.
Thank you. But what if I have 2 dates that need converting Date1 and Date2 can this be done in one compose or do I need one for each?
You need to format two dates in two Composes.
Best Regards.
thank you!