Hello!
I've scanned the community for a couple of days and been trying to solve this but comes up short.
I've got a excelfile with tables where one of the columns is a date formated one. Via a flow I'd like this date to transfer to a outlook calendar event.
This to make my teacher be able to just fill in the excel file and automatically it would create a event.
So far the event is created on the right day but I can't find a way to get the time of day to transfer from excel to calendar.
This is what I got and this gives me a event in the calendar but obvioulsy without specific time. The formatDateTime is:
Hi @mooler ,
Please take a try with expression below:
formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['endDate']),-2)), 'yyyy-MM-ddTHH:mm:ss')
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes I have tried that solution before but it gives me the followin error.
This is the expresson for the startDate:
formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['startDate']),-2)), 'yyyy-MM-ddTHH:mm:ss')
And this is the expression for the endDate:
@{formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['startDate']),-2)), 'yyyy-MM-ddTHH:mm:ss')}
The format in excel for the date is still the same as before, could it be that I need to edit the columnformatting in excel? As I said I'm fairly new to this kind of connectors so I do not see the problem as of now.
@mooler ,
Can you provide the Output from one of the failed runs to see what format Power Automate was receiving the date from Excel?
Normally, dates are stored as numbers for an even day, and with decimals if there is a time component. Since you tried using float instead of int, I assume you know this, but I figured I would throw it in anyway.
If the error is that the Int() function isn't getting an integer, we need to know what it IS getting.
also, what error do you get when using float()?
thanks,
Kyle
From a failed run I don't get any output the error message just the "invalid template" error that I posted. Same if I replace int with a float.
If I use:
formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['endDate']),-2)), 'yyyy-MM-dd')
and format the excel column without a specific time (just date):
Then I get integer output as:
The flow then runs and creates a event in Outlook but the event is created at 00.00 as the output states.
Then if I just edit the excel column to add a time to the date as below:
I don't alter anything else, when I then run the flow I get:
If i try all the date formats in the excel colum I get that same error.
If I edit the "inte" to a "float" i get the invalidtemplate error.
So how the heck do I get the output accepted with the time as well? It probably is some simple thing I'm missing but after all the trial and errors I've tried I'm probably blid to what is missing!
@mooler ,
have you tried just removing the int() part of the expression altogether?
since excel stores the DateTime as a number anyway, forcing the type conversion may be unneccessary...
I'm not sure this is the problem...i'm just troubleshooting at this point.
Kyle
I'm greatful for any input!
Unfortunately that is not a valid expression.
formatDateTime(addDays('1900-01-01', add('startDate'),-2)), 'yyyy-MM-dd')
And this give the same invalid template error as before:
formatDateTime(addDays('1900-01-01', 'startDate',-2), 'yyyy-MM-dd')
If I use just the dynamic content variables i get a "bad request" error. This was my first choice before diving in to the expressions part of this.
Like this:
The input:
and output error:
{"statusCode":400,"headers":{"Pragma":"no-cache","x-ms-request-id":"9a5710cf-b99e-49b1-95ff-f678985c58ac","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","Cache-Control":"no-store, no-cache","Set-Cookie":"ARRAffinity=fa9050a86380ecce883d8ff2e805dd22d58cc29332b6761a0fc08c7d82b3fa74;Path=/;HttpOnly;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net,ARRAffinitySameSite=fa9050a86380ecce883d8ff2e805dd22d58cc29332b6761a0fc08c7d82b3fa74;Path=/;HttpOnly;SameSite=None;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"false","Date":"Mon, 26 Oct 2020 18:42:49 GMT","Content-Length":"289","Content-Type":"application/json","Expires":"-1"},"body":{"status":400,"message":"String was not recognized as a valid DateTime.\r\nclientRequestId: 9a5710cf-b99e-49b1-95ff-f678985c58ac","error":{"message":"String was not recognized as a valid DateTime."},"source":"office365-ne.azconn-ne-01.p.azurewebsites.net"}}
@mooler ,
I was thinking more something like this, only removing the int() portion of your above expression and leaving everything else (maybe you already tried this):
formatDateTime(addDays('1900-01-01', add(items('Apply_to_each')?['endDate'],-2)), 'yyyy-MM-dd')
If that doesn't work, I would suggest you put a compose action block in your flow somewhere before the error and pass in one of our dates from Excel to see what its output is....
Yes, I did try that one and it gives a "invalid template" error.
If I put a compose between the "get row" and the "apply to each" I get the following.
Input:
va[{"@odata.etag":"","ItemInternalId":"ed853fa9-c30e-4a12-a575-9e1d9a91d452","eventName":"Historia","startDate":"43831.4166666667","endDate":"43831.4583333333","arskurs":"8A","rooms":"13"}]
Output:
va[{"@odata.etag":"","ItemInternalId":"b2e8a8ed-103b-4296-a95e-c7d59c9b7a21","eventName":"Historia","startDate":"43831.4166666667","endDate":"43831.4583333333","arskurs":"8A","rooms":"13"}]
It seems fine to me, but then again I do not know what format outlook demands for it to work.
This whole idea originated from a article where the user just used dynamic content variables and it worked. https://www.ariclevin.com/Flow/Post/outlook-events-onedrive-excel
@mooler ,
For some reason, I cannot see the message you posted in between my last two responses, but I do remember you mentioning that you originally tried using the dynamic content and it didn't work, but I cannot remember what you said regarding why it didn't work. could you please provide that information again?
It is odd since, as you said, the article is just using the dynamic content.
Unfortunately, changing the date format in excel will not change how the date/time is stored in Excel. It will still be 4XXXX.XXXXX
thanks,
Kyle
Strange it must not have been posted.
Anyway, yes I did try the dynamic content route first as this article explained https://www.ariclevin.com/Flow/Post/outlook-events-onedrive-excel
This is the dynamic content way.
The output error sais wrong date format:
{"statusCode":400,"headers":{"Pragma":"no-cache","x-ms-request-id":"4934d0b8-198f-44aa-8fc4-637bfde4bf19","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","Cache-Control":"no-store, no-cache","Set-Cookie":"ARRAffinity=2dec40ee271a11b22b991f97343df846ec15685ecd916e17e0cdc237e9bff764;Path=/;HttpOnly;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net,ARRAffinitySameSite=2dec40ee271a11b22b991f97343df846ec15685ecd916e17e0cdc237e9bff764;Path=/;HttpOnly;SameSite=None;Secure;Domain=office365-ne.azconn-ne-01.p.azurewebsites.net","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","Date":"Mon, 26 Oct 2020 19:46:59 GMT","Content-Length":"289","Content-Type":"application/json","Expires":"-1"},"body":{"status":400,"message":"String was not recognized as a valid DateTime.\r\nclientRequestId: 4934d0b8-198f-44aa-8fc4-637bfde4bf19","error":{"message":"String was not recognized as a valid DateTime."},"source":"office365-ne.azconn-ne-01.p.azurewebsites.net"}}
The input and output in a compose is:
Input:
va[{"@odata.etag":"","ItemInternalId":"86df82b7-140c-48f9-8308-f4f66f070ac2","eventName":"Historia","startDate":"43831","endDate":"43831","arskurs":"8A","rooms":"13"}]
Output:
va[{"@odata.etag":"","ItemInternalId":"86df82b7-140c-48f9-8308-f4f66f070ac2","eventName":"Historia","startDate":"43831","endDate":"43831","arskurs":"8A","rooms":"13"}]
@mooler ,
I'm sorry, but I'm at a loss...
this is past my area of experience...
@v-alzhan-msft , do you have any suggestions?
thanks,
Kyle
@mooler ,
the only other thing i can think of, is putting the date from excel into a compose or a variable, and then trying to reference that in your formatDateTime() function...
I'm just as lost, the integer generates fine but the create event connector to Outlook doesn't accept it. Go figures 😄
This is probably the point where we need to ask someone like @Jcook, @Pstork1 , or @ScottShearer
You are on the right track, but the CreateEventv4 action requires that the start and end times be in ISO 8601 format and they must include both Date and Time. Try using the following codes.
formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['startDate']),-2)), 'o')
formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['endDate']),-2)), 'o')
The 'o' specifies that the output is in ISO 8601 time/date format.
Ok! Unfortunately I don't get a success using that expression.
I did put a compose between to get the input and output. This is what is shown.
Input:
[
{
"@odata.etag": "",
"ItemInternalId": "5dce440f-b11a-4f09-b336-bb094babcd5e",
"eventName": "Historia",
"startDate": "27/10/2020 10:00:00 AM",
"endDate": "27/10/2020 11:00:00 AM",
"arskurs": "8A",
"rooms": "13"
}
]
Output:
[
{
"@odata.etag": "",
"ItemInternalId": "5dce440f-b11a-4f09-b336-bb094babcd5e",
"eventName": "Historia",
"startDate": "27/10/2020 10:00:00 AM",
"endDate": "27/10/2020 11:00:00 AM",
"arskurs": "8A",
"rooms": "13"
}
]
But the error is this:
And this is where I wonder if this could be due to the language settings in excel. My excel is in swedish but PA is in english (I've tried to force all apps to english but word en excel just won't change language).
INT is apparently HELTAL in swedish excel. Could this be the cause? I'll be damned if I know how to get excel to be english though 😄
*edit* did manage to get english as global language and checked that the INT variable was the prefered language in excel. But still get the same error.
I took a closer look at what you are doing. The Format isn't your problem. Its this part of the formula
int(items('Apply_to_each')?['startDate']),-2)
The startDate is a DateTime value and you can't use int() with that in Power Automate. Are you trying to adjust the time from the Excel Spreadsheet by subtracting two hours? If so, then use this in place of the int()
addHours(items('Apply_to_each')?['startDate'],-2)
Thanks for trying to help!
Unfortunately this did not work, I'm so far into this I'm loosing sight over what has worked and what doesn't 😄
If I try your example:
Just adding:
addHours(items('Apply_to_each')?['startDate'],-2)
or trying it like this:
formatDateTime(addDays('1900-01-01', addHours(items('Apply_to_each')?['startDate'],-2)), 'o')
I get:
So then I'm back with the ISO problem of the date value. I could use a fresh start to all this all I want to do is get a row from excel -> create a event in outlook. Next step is to figure out how a event is removed or edited if a row is edited or removed.
Any help is appreciated!
What exactly are you trying to do with the startdate? Why are you both adding hours and adding days? If you can explain what you are attempting I can try to help. But you are now getting a different error so we are definitely working on the section of the formula that is the problem.
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!
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
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.
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