cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StyleMyDoo
Helper I
Helper I

Date Time Calendar Invite using wrong times

Hi,

I have a really simple flow that when a meeting room is booked when a user fills in a SharePoint item, it sends a calendar invitation to the users added in the SharePoint item.

But if the meeting is in the afternoon, (1600 - 1700 GMT) then the calendar invite will be set for 0400 - 0500 GMT.

I've tried playing with multiple time wrappings in formula's but none seem to work and the error message I get from Power Automate is:

Flow save failed with code 'OpenApiOperationParameterValidationFailed' and message 'Input parameter 'item' validation failed in workflow operation 'Create_event_(V4)': The parameter with value '"@triggerBody()?['ArrivalDate']"' in path 'item/start' with type/format 'String/date-time' is not convertible to type/format 'String/date-no-tz'.'.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @StyleMyDoo 

 

Pls try these expressions:

 

Start Time:

formatDateTime(triggerBody()?['ArrivalDate'])

End Time:

formatDateTime(triggerBody()?['EndDate'])

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin

View solution in original post

6 REPLIES 6
ManishSolanki
Super User
Super User

Hi @StyleMyDoo 

 

You need to adjust the time zone using fx expression. In the expression, we will use convertFromUtc function.

Below is the example with 2 columns 'StartTime' & 'EndTime' for creating event in SharePoint list:

ManishSolanki_0-1707305421183.png

convertFromUtc(triggerBody()?['StartTime'],'India Standard Time')

pls replace the actual column name & target time zone as per the need in the above expression. You need to write separate expression for both start & end time while creating event.

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

 

Thanks
Manish Solanki
View my blog
Linkedin

Hi,

thanks for the tip's, when I set the Column Name and Target time zone I get this error message after re-running the flow:

InvalidTemplate. Unable to process template language expressions in action 'Create_event_(V4)' inputs at line '0' and column '0': 'In the template language function 'convertFromUtc', the value provided for the time zone id 'Greenwich Mean Time' was not valid. '.

I've tried this with both setting the target time zone as 'GMT' and 'Greenwich Mean Time'

Should the column be the name be the data entry date/time the user inputs into sharepoint? e.g. my columns are 'ArrivalDate' and 'EndDate'

Hi @StyleMyDoo 

 

Pls try the below expressions:

 

Start time:

convertFromUtc(triggerBody()?['ArrivalDate'],'UTC+12')

End time:

convertFromUtc(triggerBody()?['EndDate'],'UTC+12')

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin

Hi, @ManishSolanki 

thanks for that, the flow now completes, but the issue with +12 on every calendar invite is now that every meeting from the morning would now be showing in the evening (0900 meeting now becomes 2100 meeting)

It's a time zone issue that I think is what needs fixing, not sure why GMT/Greenwich Mean Time doesn't work properly with the flow.

StyleMyDoo_0-1707307804789.png

 

Hi @StyleMyDoo 

 

Pls try these expressions:

 

Start Time:

formatDateTime(triggerBody()?['ArrivalDate'])

End Time:

formatDateTime(triggerBody()?['EndDate'])

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin

Hi @ManishSolanki 

Thanks for the new lines, we are now able to generate the meeting invitations with the correct times xD

Helpful resources

Announcements

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (2,734)