cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

How to change Flow date from YYYY-DD-MM to DD-MM-YYYY

Hi - any help on the below would be super helpful. 

 

In SharePoint, it shows dates as DD/MM/YYYY as I changed the regional settings. I set up a flow to push out an email when things are due to expire and the email spits out the dates as YYYY/DD/MM and no matter what I do I can't change it. In SharePoint, the list is set up to show date only, not time. 

 

Is there a fix so I can show the right (for us anyway) date format? As there's a huge diff between something expiring on the 1st of Nov to the 11th of Jan. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @smather,

 

Please just try to use the function formatDateTime which could be used to return any specified format.

In my scenario, the date returned from SharePoint list is of format yyyy-MM-dd. However, I want to format it as dd/MM/yyyy.

So I used the formatDateTime function likes below:

formatDateTime(triggerBody()?['Date'],'dd/MM/yyyy')

 2.PNG3.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

24 REPLIES 24
Dorul
Responsive Resident
Responsive Resident

Hi @smather

No idea what timezone you`re using, but my example is with Eastern Europe Time.

If you want to convert a response from an approval, might try to adjust the expression:

convertTimeZone(body('Start_an_approval')?['responseDate'],'UTC','E. Europe Standard Time','dd/MM/yyyy HH:mm')

Or if you just want to convert utc:

convertTimeZone(utcNow(),'UTC','E. Europe Standard Time','dd/MM/yyyy HH:mm')

basically use  convertTimeZone(YourColumnName,'UTC','E. Europe Standard Time','dd/MM/yyyy HH:mm')

In the expression editor just move the cursor where is Your Column Name, and add the dynamic content that  you need to be converted.

Capture.JPG

 

 

 

 

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Flow-reads-datetime-always-in-UTC/m-p/16...





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





v-yamao-msft
Community Support
Community Support

Hi @smather,

 

Please just try to use the function formatDateTime which could be used to return any specified format.

In my scenario, the date returned from SharePoint list is of format yyyy-MM-dd. However, I want to format it as dd/MM/yyyy.

So I used the formatDateTime function likes below:

formatDateTime(triggerBody()?['Date'],'dd/MM/yyyy')

 2.PNG3.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That's perfect, @v-yamao-msft -- thank you! & thanks @Dorul too -- not quite what I was looking for in this instance, but I'm sure that'll come in handy down the line! 

Rajiv
Advocate II
Advocate II

I was having a lot of issues while using DD/MM/YYYY and dd/mm/yyyy along with time stamp. The dates never came correctly. Took a while to figure out the mm and MM makes a lot of difference. For dates we need dd/MM/yyyy (M in capital). mm refers to minutes. So when I was using dd/mm/yyyy, I was getting values like 15/56/2020. The capital Ms fixed it.

Hi @v-yamao-msft .

 

I'm trying the same thing, trying to use the following to convert the current date to the UK format.

 

I'm using formatDateTime(triggerBody()?['Date'],'dd/MM/yyyy') in the 'Convert to UK date' field.

 

I'm getting this error when I'm trying it though, please help!

 

Annotation 2020-01-27 095418.png

@deanking

It looks like triggerBody()?['Date'] is null, i.e. if you are getting an item from a Sharepoint list, such column has no value assigned.

There is an easy way to assign a default date value in such cases, by means of the coalesce function, in the context of a Flow execution

Hope this helps

 

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Hi @efialttes , thanks for the reply.

 

So do I just put the value in the brackets of the triggerBody()? So for example, formatDateTime(triggerBody(outputs('Compose_the_Sign-up_date'))?['Date'],'dd/MM/yyyy')

 

I've tried this also but it doesn't seem to work, am I missing something in the function?

@deanking 

Not sure if triggerBody(outputs('Compose_the_Sign-up_date') is the right expression. The names given for TRigger Outputs that you can use on expressions depend on the trigger itself.

Pleas fin enclosed an animated video on how to check these names for a specific Flow whose trigger is "Sharepoint - For a selected File":

Flow-IdentifyingTriggerOutputsNames.gif

What you can do is to add a dummy "Compose" action block after the trigger, and click on the output you are interested. Once added, you simply hover the mouse over the output and will see the name that shall be used on expressions. THis is useful when you need to add it manually to an expression, since sometimes the editor is a bit buggy.

This dummy "Compose" approach is also useful if you want to easily inspect the content of a specific trigger output in a Flow Execution.

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Hi @efialttes 

 

I'm not really following, here's a GIF of what I currently have.

 

Power Automate gif.gif

@deanking 

Let's try o explain my point it in a different way:

If the error says triggerBody()?['Date'] is null,

-either you are getting an item from a Sharepoint list, and its 'Date' column has no value assigned; or

-the expression triggerBody()?['Date'] does not exist

 

In order to verify if the expression triggerBody()?['Date'] exists, my suggestion is to add the dummy 'Compose' after the trigger, add the trigger output you are interested in, and inspect if it is declared as triggerBody()?['Date']

 

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Hi @efialttes 

 

Just checked, the date is coming from a submission made in a form using Microsoft Forms.

 

When I hover over, this is what I'm seeing body('Get_response_details')?[rae174664fcfb4c03abb1b113fe8d549e']

 

Would this mean that I'm unable to covert it to the UK format?

@deanking you could always add a Convert time zone action and select the forms answer with the time in it as the Base time and then set the format string as a custom one, i.e dd/MM/yyyy. I use that action a lot.

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.

@RobElliott 

 

Hi Rob.

 

Not really sure how I do that, I'm new to Power Automate, only been using it a month or so.

 

So would I use as follows? In bold is the dynamic content for the date on the form.

convertTimeZone(body('Get_response_details')?['rae174664fcfb4c03abb1b113fe8d549e'])

You go to add an action and type in the box Convert time zone, select it and then the action will be displayed for you to enter the different fields.

convertTimeZone4.png

Rob
Los Gallardos

@deanking

So, when you tried formatDateTime(triggerBody()?['Date'],'dd/MM/yyyy') it showed an error stating the first input (I mean triggerBody()?['Date']) was null.

If I were you I would:

1.- Add a dummy compose action block, and assign it the expression body('Get_response_details')?[rae174664fcfb4c03abb1b113fe8d549e'] as its input

2.- Run again any of your flow executions, and inspect the content of the dummy compose action block. Make sure its content is the date whose format you want to change

 

Now let's assume body('Get_response_details')?[rae174664fcfb4c03abb1b113fe8d549e'] contains the date you want to reformat:

3.-Try @RobElliott suggestion, either using the expression formatDateTime(body('Get_response_details')?[rae174664fcfb4c03abb1b113fe8d549e'],'dd/MM/yyyy') or by means of the corresponding action block (more info here )

4.- If step 3. fails then I guess you need to manipulate the date format in the tricky traditional way. See this post for more info on a similar issue

 

Hope this helps

 

 

 

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Hi @RobElliott 

 

Awesome, that worked to convert it, so how could I use that value now?

 

I'm wanting the last bit of the flow to email a user the details, so I want to email them the date but in the UK format?

@RobElliott 

 

Ignore my last comment! Figured it haha, I've overlooked it before.

 

Thanks man!

EricaBao
Community Support
Community Support

Hi @smather

 

This could be completed using the function formatDateTime. 

 

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

Please refer the solution here:

https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-change-Flow-date-from-YYYY-DD-MM-t...

 

Regards,

Erica 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Pessoal, preciso de uma ajuda, sou bem novata no power automate

Tenho o cenário que tenho uma tabela do excel, com uma coluna de vencimento e gostaria que o power automate enviasse um e-mail quando encontrasse um vencimento (hoje)+30, consegue me ajudar?

PATRICIAALQUAZ_1-1679417664974.png

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,299)