cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UC3378
Helper III
Helper III

Sharepoint calendar- edit form on powerapps sync issue

@WarrenBelz ,

 

I am having an issue with the edit form in powerapps.  When I click on the calendar date with an event, it loads the correct time, but not incorrect AM/PM.  Then if I only update say the starting time of the event, and leave the ending time unchanged, it removes the ending time altogether.  When ending time in powerapps is removed, the whole event is deleted in sharepoint.  Below are screenshots:

 

 

I initially click into an event to edit the time:

When i click in an event to edit.When i click in an event to edit.

The times look good, but instead of PM, it is showing AM.

When I clicked into edit, it is still showing AM and not PM.  The times are OK.When I clicked into edit, it is still showing AM and not PM. The times are OK.

I initially changed from 2 to 1 and that went through fine.  The second time i changed to 3 AM and did not touch the end times.  When I click into edit the event, the end time is removed.

When I changed starting time to 3, and left ending time unchanged, and go back into event, the end time is removedWhen I changed starting time to 3, and left ending time unchanged, and go back into event, the end time is removed

When i click in to see the end time is defaulted to 2001 and times are defaulted too.  In sharepoint, the event is deleted altogether.  

Then when i go in to edit, the end time is defaulted to 2001 and times are defaulted as well.  The event is deleted altogether in sharepoint.Then when i go in to edit, the end time is defaulted to 2001 and times are defaulted as well. The event is deleted altogether in sharepoint.

Hope you can help. Thanks.

 

 

8 REPLIES 8
WarrenBelz
Most Valuable Professional
Most Valuable Professional

Hi @UC3378 ,

Could you please supply the Update code in both date controls DataCards and the code on the OnSelect of the buttons. Also the DataSource and Item of the Form.

@WarrenBelz ,

 

Here are the values:

 

Update property/Start Time_DataCard1:

 

DateValue1.SelectedDate + Time( If(Dropdown13.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue1.Selected.Value), 12), Value(MinuteValue1.Selected.Value), 0)

 

Update property/End Time_DataCard1:

 

DateValue2.SelectedDate + Time( If(Dropdown15.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue2.Selected.Value), 12), Value(MinuteValue2.Selected.Value), 0)

 

OnSelect property on the pencil edit icon to open the event to edit:

 

EditForm(EditForm);
Set(_popup, false);        //make view event gallery group not visible
Set(_EditPopup, true);  //make edit form visible

 

Clicking pen icon to bring up the edit formClicking pen icon to bring up the edit form

 

OnSelect property on the save button of the edit form:

 

SubmitForm(EditForm); Set(_EditPopup, false);
ClearCollect(TestCol, Sort(Filter(TestCal, DateValue(Text('Start Time')) > 0 ), EventDate, Ascending));   

//TestCol is collection that holds all events present in the TestCal calendar in sharepoint.  I added this as a way of refreshing the TestCol when a new event is added or updated.  

Save button to save updatesSave button to save updates

 

Datasource property of the edit form:

 

TestCal    //sharepoint calendar

 

Item property of the edit form:

 

Gallery5.Selected    //Gallery5 is the gallery I used to display the selected event when i click on the day in the calendar

 

//This is Gallery5 used to display the selected event(s) on that particular day: 

This is Gallery5This is Gallery5

 

Thank you!

WarrenBelz
Most Valuable Professional
Most Valuable Professional

Thanks @UC3378 ,

Your SubmitForm should simply write the Update properties of the date controls back to data source (SharePoint) except the data source of the edit form is the collection TestCal, not the SharePoint list. 

I believe that you need to either Patch/UpdateIf the contents of the collection to the SharePoint item or change the data source to the list item. Can you please explain more of your logic on the collection?

 

 

 

@WarrenBelz ,

 

Sorry if I made it confusing.  TestCal is the sharepoint calendar, and TestCol is the collection.  Here is the logic:

 

1) When the app is first loaded, all the TestCal sharepoint calendar events are copied into the TestCol Collection.  This is how the powerapp calendar is able to show the events. 

 

2) I would click into a specific day of the calendar if I wanted to modify an event.  

 

3) If I want to modify an event, I click the day containing that event on the calendar, Gallery5 loads with the items filtered from the TestCol collection.  It is filtered by 'Start Time' = _dateSelected.  So it only shows the records with the day i selected on the calendar.  Multiple events could be shown for each particular day. 

 

4) I would click on the pencil edit icon to modify a particular event from that day.  It will open the Edit Form.  The Edit Form's Item is Gallery5.Selected.  So the Edit Form will populate whatever I selected to edit from the previous Gallery5 screen.  The DataSource of the Edit Form is the TestCal SharePoint calendar.  

 

5) Once I am done modify an event (change the date or time), I would hit the save button.  The save button submits the Edit Form back to the TestCal Sharepoint calendar.  Then I do a ClearCollect to refresh the TestCol collection, so fresh data is copied from the TestCal sharepoint calendar to the TestCol collection.  The new and updated events are then shown on the powerapps calendar.  

 

I think the AM/PM drop down is not getting updated when the Edit Form loads the items from the collection.  Then when I submit form, whichever DataCard (mostly End Time Datacard) is not modified, it throws an error or it defaults it back to 2001. Below is my TestCol collection.

 

The TestCol collection showing the start time  (EventDate) and the end time (EndDate)The TestCol collection showing the start time (EventDate) and the end time (EndDate)

 

Sorry if I confused you, I hope this explains it some more.  Thank You for your help. 

WarrenBelz
Most Valuable Professional
Most Valuable Professional

Hi @UC3378 ,

Sorry for the late response - when you mention SharePoint Calendar, I assume you are referring to a normal List with dates etc in it.

How are you loading and storing Events?

Hi @WarrenBelz ,

 

Sorry for the late reply.  I have not been able to work on my app because my environment is missing. I have put a ticket into MS so i'm waiting.  I might even have to wait on my issue with the app.  I found something in my app that could warrant my immediate attention.  Perhaps you can help me with that?

 

So the problem is when i create a multi event in sharepoint, say 4 day event.  When the list is copied over to PA into a collection, it is showing up as one record with the start and end date.  But the way I am structuring in my calendar, I want each event to show up on the calendar as a label within a gallery.  The problem is it only sees the start and end date so anything in between it doesn't see so it does not populate with the event on the calendar.  So long story short, I'm thinking of adding the in between event days into the collection by using ForAll and if statements and maybe even With function.  The problem is I also need to use an incrementor with the Set() but it can't be within a ForAll.  It's just frustrating there are so many limitations.  I know its hard for me to describe my current issue without showing you much but how can I increment a variable within a ForAll without using Set?

 

Thanks

WarrenBelz
Most Valuable Professional
Most Valuable Professional

Hi @UC3378 ,

I understand generally your requirement.

While you are waiting to test this, have a look at the DateAdd and DateDiff functions, which can set dates before or after and tell you the number of days in between.

@WarrenBelz ,

 

Thanks for helping.  I have used DateDiff but I think DateAdd will be able to help me.  I also for incrementing without using Set function, it might be helpful to populate a collection with each row containing numbers from 1 - whatever.  I will let you know how it goes when i get my account back. Thanks again.

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

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

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

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!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

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  

Top Solution Authors
Top Kudoed Authors
Users online (3,522)