cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yansian
Level: Power Up

Creating an App for a coach to track attendance at training sessions

Hello,

 

I'm new to PowerApps but would like to give it a shot and make an app that keeps track of player attendance at training sessions.

 

My basic need is to be able to select the training session and then select if a player is present or absent using buttons). The button would turn green/red after pressing and the data would update spreadsheet weather a player was present or absent for a particular session. I have attached some photos of a basic design and the spreadsheet I currently use.

 

If anyone could point me to a tutorial that would help create something like this, it would be much appreciated.

 

Thanks

 

Community Support Team Rank
Community Support Team

Re: Creating an App for a coach to track attendance at training sessions

 Hi @yansian,

 

First of all, since your are new to PowerApps, I would like to suggest that you first create this excel table(you need to format the table then save it), and then create an auto-generated app by selecting Home > Start from data > OneDrive(for example) > Select the file and then table name. You could try out this app to see if this app could meet your requirement.

 

After testing with this app, if you still insist to achieve with your way, then we will start from here:

 

It seems that you want to update records in PowerApps. But one thing I want to clear is that instead of using 2 buttons to achieve this, you need to use chech box instead. This is because that if you insert the button control inside the gallery, then we need to use Set function to change the Fill property(color) of the button, and once you select any button, all buttons in this gallery will change the color. If you could accept to use a checkbox instead of button controls, then this could be achieved following below steps:

 

You will need 11 DataEntry screens, each screen for each session. I will just mention how to create 2 of them as an example. 

 

1. In MainMenu screen, insert 11 buttons, and set each button's Text property to your session name. For example, for session1 button, set its Text property to:

 

"Session1"

 

Set its OnSelect property to:

 

Navigate(DataEntry1,None)

 

 

 

For session2 button, set its Text property to:

"Session2"

Set its OnSelect property to:

Navigate(DataEntry2,None)

 1.JPG

 

2. In your DataEntry1 screen, add a Gallery control, set its DataSource to:

 

Table1

 

And only add the column for Player Name in this Gallery.

2.JPG

 

Then select the first part(template part) of Gallery and then insert a checkbox control. Set the Default property of this checkbox control to:

 

If(ThisItem.Session1="Present",true,false)

 

Set the Text property of this checkbox control to:

 

"Present"

 

 

 

Insert a button control, set its Text property to:

 

"Submit"

 

And its OnSelect property to:

 

ForAll(Filter(BrowseGallery1.AllItems,Checkbox1.Value=true),Patch(Table1,LookUp(Table1,Player_x0020_Name = Title1.Text),{Session1:"Present"}));ForAll(Filter(BrowseGallery1.AllItems,Checkbox1.Value=false),Patch(Table1,LookUp(Table1,Player_x0020_Name = Title1.Text),{Session1:"Absent"}));Back()

 

Capture.JPG

3. In your DataEntry2 screen, repeat all steps in Step2, only change "Session1" to "Session2", and change the related controls' names.

 

This works perfectly for me. Hope this could help.

 

Regards,

Mona

 

o365masters
Level: Powered On

Re: Creating an App for a coach to track attendance at training sessions

Although I don’t go into detail in a blog I have posted about doing pretty much exactly what you are talking to, I did share a demo video of the app I built on my blog post that may given you some pointers 🙃.
https://masteroffice365.com/renderlistdataasstream-demo-sourcecode/

If you have more specific questions about it, I can try assist you with further pointers...
Super User Rank
Super User

Re: Creating an App for a coach to track attendance at training sessions

Hi @yansian,

 

I would take a completely different approach to designing  your app.  The problem you describe seems to best fit a many to many relationship that is classically described by Students and Courses or in the illustration Authors and Projects.  Each student can attend many courses and each course can enroll many students.  From a design standpoint, three separate tables are typically used. Capture.PNG

 The central table is called a junction table.  In your case, the Junction table would include a field for attendance (ie. Status) and a date for the Session in addition to the two foreign keys.  This design would greatly simplify your app and provide you with an easy way to add or subtract Sessions and Players.  I have a tutorial in the Community Blog that explains the process of designing the back end for your app.  Relational-Database-Principles-and-PowerApps-Step-3-Keys-and relationships addresses this issue specifically but you can start with the first post and follow them to the end.  Only three entry screens would be required, one for each table.  A gallery screen with a dropdown control loaded from the Student table and a data table control showing the sessions filtred by selected student, along with the status and date of attendance.  Likewise a second gallery screen could have a dropdown loaded with the sessions and a data table showing the students who attended that session.