web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Appointment booking sl...
Power Apps
Answered

Appointment booking slots - no double bookings

(0) ShareShare
ReportReport
Posted on by

Hi All, 

 

Was wondering if someone can help me with the following scenario which I want to implement! 

 

So I have a Sharepoint list which has the following titles:

 

Screenshot 2020-07-20 at 1.12.02 PM.png

 

 

And a power app layout as follows 

 

I have a calendar component, a drop down that contains all the time slots and the name of the person filling this out. 

 

Screenshot 2020-07-20 at 1.12.29 PM.png

 

Here is the issue! I want to connect them together and click to my sharepoint list. Inputting the date, time slot and name!  (keeping a log of the people filling out the app)

 

I also want the the person filling out this app to not be able to have the same date/ time slot as someone who has previously filled it out. 

 

Please help! is this possible and can someone show me how to link this all together or put me in the right direction! 

 

 

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @AB21 ,

     

     

    Try to configure some logic condition before saving the data to list. Use LookUp function to check if there is a record with the same Date and Time slot.

    If(IsBlank(LookUp('SP list', 'Time slot'=DropdownName.Selected.Value && Date=DateValue(Text(CalendarComponent.StartDate))).ID, 
    Patch('SP list', Defaults('SP list'), {'Full Name':TextInput.Text, Date: DateValue(Text(CalendarComponent.StartDate)) , 'Time slot'=DropdownName.Selected.Value}), Notify('The date and time have been selected. Please select another time'))

    Hope this helps.

    Sik 

  • AB21 Profile Picture
    on at

    Hi @v-siky-msft ,

     

    Thanks for this! where would this code go? on the calendar, drop down or text input? 

     

    Sorry I'm such a novice!

     

    Thanks in advance

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @AB21 ,

     

    Try to put the code to OnSelect property of SubmitButton.

    The code will be triggered when the button is clicked, and check if the Date and Time slot exist in the list before save. if exist a notification will show to warn user.

    If(
    IsBlank(LookUp('SP list', 'Time slot'=DropdownName.Selected.Value && Date=DateValue(Text(CalendarComponent.StartDate))).ID,
    Patch('SP list', Defaults('SP list'), {'Full Name':TextInput.Text, Date: DateValue(Text(CalendarComponent.StartDate)) , 'Time slot'=DropdownName.Selected.Value}),
    Notify('The date and time have been selected. Please select another time')
    )

    Sik

     

  • AB21 Profile Picture
    on at

    HI @v-siky-msft 

     

    Thanks again for your amazing help! I am so close! 

     

    here is the code after adjusting it to my details:

     

    If(
    IsBlank(LookUp('Parent Booking', 'Time slot'=DropdownName1.Selected.Value && Date=DateValue(Text(Calendar_1.StartDate))).ID,
    Patch('Parent Booking', Defaults('Parent Booking'), {'Full Name':TextInput.Text, Date: DateValue(Text(Calendar_1.StartDate)), 'Time slot'=DropdownName1.Selected.Value}),
    Notify('The date and time have been selected. Please select another time')
    )

     

     

    Screenshot 2020-07-23 at 3.47.42 PM.png

     

    but im getting some errors! 

     

    where am I going wrong? 

     

    Screenshot 2020-07-23 at 3.48.40 PM.pngScreenshot 2020-07-23 at 3.49.08 PM.pngScreenshot 2020-07-23 at 3.49.25 PM.pngScreenshot 2020-07-23 at 3.49.37 PM.png

     

    Thanks again for you help, really appreciate it 

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @AB21 ,

     

     

    You need to replace the control name in the formula. please try this:

    If(
    IsBlank(LookUp('Parent Booking', 'Time slot'=Dropdown1.Selected.Value && Date=DateValue(Text(Calendar_1.StartDate))).ID),
    Patch('Parent Booking', Defaults('Parent Booking'), {'Full Name':TextInput1.Text, Date: DateValue(Text(Calendar_1.StartDate)), 'Time slot':Dropdown1.Selected.Value}),
    Notify('The date and time have been selected. Please select another time')
    )

     

    Hope this helps.

    Sik

  • AB21 Profile Picture
    on at

    Hi @v-siky-msft 

    thanks once again, I now have 4 errors which I'm struggling to figure out:

     

    Screenshot 2020-07-24 at 1.36.14 PM.pngScreenshot 2020-07-24 at 1.36.25 PM.pngScreenshot 2020-07-24 at 1.36.35 PM.pngScreenshot 2020-07-24 at 1.36.45 PM.png

     

    do you know how I go by fixing these? also in my drop down I want to add times like 10:00, 10:30, 11:00. How do I add it in iv tried [“10:00″,”10:30″,”11:00”] but didnt work.

     

    Can you please help?

     

    Thank in advance

  • AB21 Profile Picture
    on at

    Hi @v-siky-msft 

     

    I have sorted the Drop down errors its just the 4 errors that I screenshot in the last reply! 

     

    Thanks in advance

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @AB21 .

     

    Glad to see it. Is there anything else I can help?

    Sik

  • AB21 Profile Picture
    on at

    Hi @v-siky-msft ,

     

    I have two last errors! thanks for your help and was wondering if you can help on these last two? 

     

    here are the screenshots 

     

    Screenshot 2020-07-27 at 12.05.08 PM.pngScreenshot 2020-07-27 at 12.05.18 PM.png

     

    code :

    If(
    IsBlank(LookUp('Parent Booking_1', 'Time slot'=Dropdown1.Selected.Value && Date=DateValue(Text(Calendar_1.StartDate))).ID),
    Patch('Parent Booking_1', Defaults('Parent Booking_1'), {Title:TextInput1.Text, Date: DateValue(Text(Calendar_1.StartDate)), 'Time slot':Dropdown1.Selected.Value}),
    Notify('The date and time have been selected. Please select another time')
    )

     

     

    Thanks in advance!

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @AB21 ,

     

    Where are these error red waves located?

    The first error means there is something wrong with these Name, please check if these List Names, Control Names and column Names are correct.

    The second error, the notification text should be wrapped by double quotes.

    Notify("The date and time have been selected. Please select another time")

    Hope this helps.

    Sik 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard