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

Sharepoint and powerapps calendar

 

Hello I am trying to allow user to only submit Start date and time once. I am using SharePoint Calendar and submitting the form using powerApps

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Ok @Gene1 

I have changed the logic, please try this:

ClearCollect(ColLocation,Filter('Calendar Name',Location =Location_DataCard1.Update )); Clear(ColTest);
ForAll(ColLocation,If('End Time_DataCard1'.Update<='End Time' && 'Start Time_DataCard1'.Update >= 'Start Time', Collect(ColTest,true)));
If(true in ColTest,Notify("Schedule Repeated",NotificationType.Error),SubmitForm(FormName))

Sik

View solution in original post

4 REPLIES 4
v-siky-msft
Community Support
Community Support

@Gene1 

 

How do you want to submit the events? By EditForm or Patch function?

''I also would like to have the end date be the same as start date. However be able to put start time and date.' - What does this sentence mean?

If you want to use EditForm, try to add judgment condition to OnSelect property of submit button, if the schedule is repeated, show an error notification, else then submit the form.

 

ClearCollect(ColLocation,Filter('Calendar Name',Location =Location_DataCard1.Update ));If('End Time_DataCard1'.Update in Filter(ColLocation, 'Start Time'='Start Time_DataCard1'.Update).'End Time',Notify("Schedule Repeated",NotificationType.Error),SubmitForm(FormName))

 

Snipaste_2020-01-31_21-25-45.png

Sik

 

Hello Sik,

 

Thank you for this solution! It partially works, for example:

If I add 7am-8am and try to add the time again does not let me submit the form which is awesome. However, If I add 7am-9am and then 7:30am-8am let's me submit even though the 7am-9am time frame is already reserved.

 

Are you able to give a work around for this issue?

 

Thank you in advance @v-siky-msft 

v-siky-msft
Community Support
Community Support

Ok @Gene1 

I have changed the logic, please try this:

ClearCollect(ColLocation,Filter('Calendar Name',Location =Location_DataCard1.Update )); Clear(ColTest);
ForAll(ColLocation,If('End Time_DataCard1'.Update<='End Time' && 'Start Time_DataCard1'.Update >= 'Start Time', Collect(ColTest,true)));
If(true in ColTest,Notify("Schedule Repeated",NotificationType.Error),SubmitForm(FormName))

Sik

View solution in original post

Thank you, it is working well so far! Truly appreciate your help @v-siky-msft 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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