Hi,
I have a string that comes from an Output like this:
["05/22/2019 00:00:00"]
And I would like to know the day of the week and the month written in letters to be sent on an email like this:
"Tomorrow Wednesday, the 22nd of May, ..."
There is no way I could make it work 😞
Thank you for your help!
Guillermo
Solved! Go to Solution.
Note: If the string is coming in the type:
["05/22/2019 00:00:00"]
you need to do another compose action to extract just the date and time by using :
substring(variables('re'), 2, 19)
here 're' is my variable with the string (["05/22/2019 00:00:00"])
your next compose action will be:
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Here compose_2 is the output of the substring.
Hope this helps!
Thanks,
Hi,
You can follow the steps as shown in the screenshot to compose the date and time accordingly.
Expression: formatDateTime(variables('re'), 'yyyy MMMM dddd')
This will give you the desired format : formatDateTime(variables('re'), 'dddd, dd''nd'' ''of'' MMMM')
The expression can be modified.
Thanks,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
An alternative to @yashag2255's answer is to use the convert time zone action (see image below):
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi,
I get the following error when implementing the solution:
What could it be wrong?
Thank you again
Hi @Anonymous
Please check that the date time string is of the form :
05/22/2019 00:00:00
Add a compose action with the expression:
formatDateTime(variables('re'), 'dddd, dd''nd'' ''of'' MMMM')
Please note that 're' is a variable that I have created.
Can you post a screenshot of your compose action so that we can assist you better?
Thanks,
Note: If the string is coming in the type:
["05/22/2019 00:00:00"]
you need to do another compose action to extract just the date and time by using :
substring(variables('re'), 2, 19)
here 're' is my variable with the string (["05/22/2019 00:00:00"])
your next compose action will be:
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Here compose_2 is the output of the substring.
Hope this helps!
Thanks,
hi,
it worked!!
Compose 4 does a Union to get unique values
Then it is saved on a variable of type string
And then the replacing you suggested.
Finally formatDateTime(...) worked!!!
Awesome, I will validate your response.
But then surely if you use ''nd'' and the date is the 4th of the month you'll get the wrong result. 4nd isn't right!
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Perfect! Glad that it worked for you.
Thanks,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
70 | |
24 | |
18 | |
16 | |
13 |
User | Count |
---|---|
133 | |
43 | |
32 | |
32 | |
28 |