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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Time slot booking system
Power Apps
Unanswered

Time slot booking system

(0) ShareShare
ReportReport
Posted on by

I am pretty new to power apps and I want to create a teacher booking system form (for a parents evening kind of event where students would use the app to book with the teacher) using Power Apps that has a dropdown list of available times that increment by 15 minutes. I would like to use a Sharepoint list to keep the data and populate the dropdown list. In addition, I would like for the time slot to be removed from the dropdown list once it has been selected. Is this possible in Power Apps? Once the slot has been booked can an email be send out to the teacher to confirm that the booking as been selected by that particular student.

 

I want this to be a tablet or web based app 

 

Thanks in advance for any help given!

Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    on at

    Hi @AB21 ,

    Do you want to design an app for booking and using sharepoint as data source?

    This is similar to meeting template screen and book a room template app. I suggest you refer these two templates about how to design this kind of app.

    26.PNG

     

    261.PNG

     

    However, please notice that both these two templates use office365 outlook calendar as data source, not sharepoint.

    So you could not use them directly.

    Here is some advice:

    1)create a list with these fields: teacher (person type), student(person type), start time(datetime type),end time(datetime type)

    2)connect your app with this list, connect with Office365 outlook

    3)insert a combo box(for teacher), a datepicker(for date),a drop down(for time)and a submit button like this:

    263.PNG

     

     4)set the screen's OnVisible:

    ClearCollect(timesheet,{time:"10:00 AM-10:15 AM"},{time:"10:15 AM-10:30 AM"},{time:"10:30 AM-10:45 AM"},{time:"10:45 AM-11:00 AM"},{time:"11:00 AM-11:15 AM"},{time:"11:15 AM-11:30 AM"},{time:"11:30 AM-11:45 AM"},....);
    ClearCollect(timesheet2,AddColumns(timesheet,"time1",TimeValue(Left(time,8)),"time2",TimeValue(Right(time,8))))
    //build a table with all the time choices

    set teacher combo box's Items:

     

    Choices(listname.teacher)

     

    set the datepicker's OnChange:

    ClearCollect(filteredlist,
     AddColumns(
     Filter(list,DateValue(Text(starttime))= DatePicker1.SelectedDate,
     teahcer=teacher drop down.Selected
     ),
     "time3",TimeValue(Text(starttime)),
     "time4",TimeValue(Text(endtime))));
    //filter list based on the teacher and date that you select, insert two fields only with time data
    ForAll(ClearCollect(busytime,
     ForAll(filteredlist,Filter(timesheet2,time1>=time3,time2<=time4))
     ), //filter timesheet to get the unavailable time
     Collect(busytime2,Value.time)
     )
    //get all the data from nested table

    //You could use this to get all the data from nested table:

    ForAll(originaltable,Collect(newcollection,fieldname.nestedfieldname))

    set the time drop down's Items:

    Filter(timesheet2,Not(time in busytime2.time))

    Then the drop down will only display the available time choices.

    set the submit button's OnSelect:

    Office365Outlook.SendEmailV2(teacher drop down.Selected.Email,subject,body)

    //please replace with the subject and body that you want.

    You could try this:

    Office365Outlook.SendEmailV2(teacher drop down.Selected.Email,"book teacher","student name:"&User().FullName&"date:"&date picker1.SelectedDate&"time:"&time drop down.Selected.time)

    If you want to update your list by clicking this button too, you could try :

    Office365Outlook.SendEmailV2(teacher drop down.Selected.Email,"book teacher","student name:"&User().FullName&"date:"&date picker1.SelectedDate&"time:"&time drop down.Selected.time);
    Patch(list,Defaults(list),{teacher:combo box.Selected,
    student:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:"i:0#.f|membership|" & User().Email,
     Department:"",
     DisplayName:User().FullName,
     Email:User().Email,
     JobTitle:"",
     Picture:""
     },
    starttime:time drop down.Selected.starttime,
    endtime:time drop down.Selected.endtime
    })

     

     

    Best regards,

  • AB21 Profile Picture
    on at

    Hi! 

     

    Thank you for this!

     

    With the table, (with all the time slots) where do I create this? 

     

    Sorry for a simple question but I have no clue!

     

  • v-yutliu-msft Profile Picture
    on at

    Hi @AB21 ,

    Do you mean that where to create a table will all the time choices?

    I've mentioned in my last reply:

    set the screen's OnVisible:

    ClearCollect(timesheet,{time:"10:00 AM-10:15 AM"},{time:"10:15 AM-10:30 AM"},{time:"10:30 AM-10:45 AM"},{time:"10:45 AM-11:00 AM"},{time:"11:00 AM-11:15 AM"},{time:"11:15 AM-11:30 AM"},{time:"11:30 AM-11:45 AM"},....);
    ClearCollect(timesheet2,AddColumns(timesheet,"time1",TimeValue(Left(time,8)),"time2",TimeValue(Right(time,8))))
    //build a table with all the time choices

     

     

     

    Best regards, 

  • AB21 Profile Picture
    on at

    Hi 

     

    Sorted that ! 

     

    next error im getting? 

     

    Screenshot 2020-02-06 at 9.42.37 AM.png

  • v-yutliu-msft Profile Picture
    on at

    Hi @AB21 ,

    I suggest you create a sharepoint list to store the booking information.

    Like I mentioned:

    create a list with these fields: teacher (person type), student(person type), start time(datetime type),end time(datetime type)

     

    You need to replace with the listname and field name that you use in your list.

    set teacher combo box's Items:

     

    Choices(your listname.your teacher fieldname)

     

    In my test, many tablenames and fieldsname is just an example.You need to replace them with the names that you use.

    My formulas are just for your reference.

     

     

    Best regards,

  • AB21 Profile Picture
    on at

    Im clearly doing something wrong again. When I change the OnChange to

     

    ClearCollect(filteredlist,
     AddColumns(
     Filter(list,DateValue(Text(starttime))= DatePicker1.SelectedDate,
     teacher=teacher drop down.Selected
     ),
     "time3",TimeValue(Text(starttime)),
     "time4",TimeValue(Text(endtime))));
    ForAll(ClearCollect(busytime,
     ForAll(filteredlist,Filter(timesheet2,time1>=time3,time2<=time4))
     ), 
     Collect(busytime2,Value.time)
     )

     

    Is there something in the code I need to change?

  • mi9ll Profile Picture
    2 on at

    Thanks Phoebe for this as it has helped me half way through my process as i am only a few weeks into using powerapps. However, I am struggling with doing the filtering. So i did a customised calendar using vertical and horizontal gallery (https://docs.microsoft.com/en-us/archive/blogs/davidni/building-an-interactive-calendar-view-with-powerapps) , I am able to collect the value only as a day but not able to convert it to a full date. 

    So there is no onchange option and the datepicker option (DatePicker1.SelectedDate) will not work. Please how will i resolve this so that the day can be converted into a date? and it can also show me the time slots available for that date?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard