cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Sharepoint and powerapps calendar

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
Highlighted
Community Support
Community Support

Re: Sharepoint and powerapps calendar

@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

 

Highlighted
Frequent Visitor

Re: Sharepoint and powerapps calendar

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 

Highlighted
Community Support
Community Support

Re: Sharepoint and powerapps calendar

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

Highlighted
Frequent Visitor

Re: Sharepoint and powerapps calendar

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,646)