cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAppUser87
Frequent Visitor

Manipulating Flow Excel Date

Hello,

 

I have an excel table that I want to use to populate a Journal through flow.

 

The excel table looks like this: The column is formatted to the Date Format:

Flow Pic 1.png

 

When Flow Picks up the table (List Rows Present in a Table Action) it is reading this date as a String:

Flow Pic 2.png

 

I have tried all sorts of conversions that I can think of but it just doesn't like my string! Does anyone have any idea how I can convert the 43710 to dd/MM/yyyy?

 

Thankyou fo

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

Hi @PowerAppUser87 

 

Excel stores internally the dates as sequential serial numbers starting from January 1, 1900, to enable calculations. 

 

So you need to define a date for January 1, 1900, and add the value returned by Excel. Notice that that value is serial number 1 so you need to take two days in the final calculation. Why 2? The first is because the count starts at one and not zero, so you need to take that number off; otherwise, you'll. The other one is a little bit more tricky. For some reason, if you only subtract one, it will display the next day. 

 

Here's a structure of steps.. You can do them all in the "compose" action with formula, but I wanted to show each step.

 

small-Screenshot 2019-09-20 at 09.09.42.png

 

First, the date is a string, so we need to convert it into an int.

 

 

int(body('Get_a_row')?['Date'])

Then take the two days off

 

 

And finally, add the days.

 

addDays('01/01/1900',variables('Date'),'dd/MM/yyyy')

 

 

With this, you'll get a date that you can use

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

View solution in original post

11 REPLIES 11
manuelstgomes
Community Champion
Community Champion

Hi @PowerAppUser87 

 

Excel stores internally the dates as sequential serial numbers starting from January 1, 1900, to enable calculations. 

 

So you need to define a date for January 1, 1900, and add the value returned by Excel. Notice that that value is serial number 1 so you need to take two days in the final calculation. Why 2? The first is because the count starts at one and not zero, so you need to take that number off; otherwise, you'll. The other one is a little bit more tricky. For some reason, if you only subtract one, it will display the next day. 

 

Here's a structure of steps.. You can do them all in the "compose" action with formula, but I wanted to show each step.

 

small-Screenshot 2019-09-20 at 09.09.42.png

 

First, the date is a string, so we need to convert it into an int.

 

 

int(body('Get_a_row')?['Date'])

Then take the two days off

 

 

And finally, add the days.

 

addDays('01/01/1900',variables('Date'),'dd/MM/yyyy')

 

 

With this, you'll get a date that you can use

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

jpheeter
Regular Visitor

Hi @PowerAppUser87 

I've been tossing this into the fx field and it seems to work pretty well. 

addDays('12/30/1899',int(items('Apply_to_each')?['Due Date']),'yyyy-MM-ddTHH:mm:ss')

The part in red comes from the excel date field, I just converted the serial date to an int in line. I also figured it was faster to just change the start date to account for the 2 days added in the count. @manuelstgomes gave a great explanation in his answer that lead me to my inline tweak.

You were right!  With '01/01/1900' being used, the output was 2 days too many, while '12/30/1899 is accurate.

Yesss!! I used this as an expression, and it worked without all the variables and conversions. Thank you very much!!

Anonymous
Not applicable

For me was enough with select ISO 8601 in the DateTime format when get the rows in the table excel:

juanortiz_0-1615515570830.png

 

Powerplatform01
Post Patron
Post Patron

@PowerAppUser87 

Watch this video to resolve your issue.Also request you to please subscribe

https://youtu.be/NLEMPn-T3ns

Brilliant, thanks for sharing this tip.  All my imported decimal date time stamps magically changed to the required iso format. Thankyou @Anonymous 

For me, this IS the solution. Wish I had noticed that drop-down before trying repeatedly to convert the date. Thank you!

Thanks @manuelstgomes !

This has stumped me many times... maybe if I comment here I'll find the thread easier the next time this confuses me!

And here's the Google search which led me here:

excel sharepoint power automate 5 digit date format

Hi

I have used exact same expression to get the date in date format however, I have having error as 

OpenApiOperationParameterTypeConversionFailed. The 'inputs.parameters' of workflow operation 'Update_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/Cargo_x0020_Ready_x0020_Date' is required to be of type 'String/date'. The runtime value '"30-06-2020"' to be converted doesn't have the expected format 'String/date' while writing to SP list. Do you have any suggestion?

 

Thanks

@Akuner Are you writing that date value to a "Date and Time" field in SharePoint list?

Might need to convert to Zulu time format, like "2020-06-30T00:00:00+00:00" or just "2020-06-30T00:00:00".


What does the value you are trying to write to SP list look like in a Compose action? Can you provide a screenshot? Like add a Compose action right before the 'Update_item' action, and put

 

@{item()['Cargo_x0020_Ready_x0020_Date']}

 

in that Compose. What does it look like, just "30-06-2020"?? To be clear, is your value a string like [30-06-2020] without the brackets, or is it double quoted within the string? Like open the flow run and click "view all outputs" on the Compose you just created. Does the JSON look like "\"30-06-2020\"" or "30-06-2020"?? There should only be one pair of double quotes around that value when you look at the JSON output of the compose action.

Converting date/time values in Power Automate is no picnic. Seems that you have a format which needs to be converted in the reverse direction from what is typical, and I've not been able to figure out a surefire way to do that with a simple function. So I would just use split(), concat(), and take() to manually compose the correct format in a function like this:

 

@{concat(last(split(item()['Cargo_x0020_Ready_x0020_Date'],'-')),'-',last(take(split(item()['Cargo_x0020_Ready_x0020_Date'],'-'),2)),'-',first(split(item()['Cargo_x0020_Ready_x0020_Date'],'-')),'T00:00:00')}

 


I have not tested that function but it should get you close to what you need.

https://docs.microsoft.com/en-us/troubleshoot/power-platform/power-automate/how-to-customize-or-form...

https://manueltgomes.com/reference/powerautomate-function-reference/formatdatetime-function/

https://en.wikipedia.org/wiki/ISO_8601

Helpful resources

Announcements

Register now for the Business Applications Launch Event | Tuesday, April 4, 2023

Join us for an in-depth look into the latest updates across Microsoft Dynamics 365 and Microsoft Power Platform that are helping businesses overcome their biggest challenges today.   Find out about new features, capabilities, and best practices for connecting data to deliver exceptional customer experiences, collaborating, and creating using AI-powered capabilities, driving productivity with automation—and building towards future growth with today’s leading technology.   Microsoft leaders and experts will guide you through the full 2023 release wave 1 and how these advancements will help you: Expand visibility, reduce time, and enhance creativity in your departments and teams with unified, AI-powered capabilities.Empower your employees to focus on revenue-generating tasks while automating repetitive tasks.Connect people, data, and processes across your organization with modern collaboration tools.Innovate without limits using the latest in low-code development, including new GPT-powered capabilities.    Click Here to Register Today!    

Power Platform Connections - Episode 5 | March 16, 2023

Episode Five of Power Platform Connections sees David Warner and Hugo Bernier talk to Vice President of Power Automate, Stephen Siciliano, alongside the latest news, product reviews, and community blogs.     Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show!      Show schedule in this episode:  0:00 Cold Open  0:34 Show Intro  01:09 Stephen Siciliano Interview  30:42 Blogs & Articles  31:06 PnP Weekly Ep 200  32:51 SharePoint Custom Form Backup  33:38 Power Apps Extreme Makeover  34:56 ChatGPT Control  35:35 Color Data  37:17 Top 7 Features on Dynamics 365 2023 Release Wave 1  38:30 Outro & Bloopers  Check out the blogs and articles featured in this week’s episode:    https://pnp.github.io/blog/microsoft-365-pnp-weekly/episode-200/​ (no tags)   https://grazfuchs.net/post/sharepoint-customform-backup/ @Maximilian Müllerhttps://www.fromzerotoheroes.com/ @Kristine Kolodziejski​ https://github.com/Power-Maverick/PCF-Controls/tree/master/ChatGPTControl @DanzMaverick https://yerawizardcat.com/color/ ​ @CatSchneider https://events.powercommunity.com/dynamics-power-israel/ @VictorDantas  Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse.  This episode premiered live on our YouTube at 12pm PST on Thursday, 16th March 2023.  Video series available at Power Platform Community YouTube channel.    Upcoming events:  Business Applications Launch – April 4th – Free and Virtual! M365 Conference - May 1-5th - Las Vegas Power Apps Developers Summit – May 19-20th - London European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas  Join our Communities:  Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community  If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.     

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.   Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.      Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.    Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218   tom_riha      theapurva        Akash17        BCLS776        rampprakash        Rusk        cchannon        a33ik        AaronKnox        Matren        Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas        If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Users online (4,438)