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 / Is it possible to crea...
Power Apps
Answered

Is it possible to create a button for every student in a list

(0) ShareShare
ReportReport
Posted on by 58

Is it possible to code this?

 

I have 20 students. Can I write a script that would count the amount of users in a list and create a button for every user?

 

im trying to create a register for a fire alarm and want staff to use buttons rather than radio buttons/drop downs etc. 

 

when you press the button it goes a different colour and adds a number to a variable so it counts the total students present. 

Categories:
  • Verified answer
    Gochix Profile Picture
    1,937 Moderator on at

    You can use a gallery, set your desired filters or just connect to your data source, add text label where label would be as "ThisItem.StudentName" replacing StudentName of the actual column where your student name is set. Add a button to this gallery, now you should have a button next to each student name.

     

    Change the buttons OnSelect option to some kind of trigger action. If you have a column in your datasource called Status or something, then buttons OnSelect would be.

    UpdateIf(DataSource,ID = ThisItem.ID,{Status:{Value:"Present"}})



    then use gallery option = TemplateFill, there you can play around and use something like = 

     

    If(ThisItem.Status="Present",RGBA(0, 0, 0, 0),RGBA(99, 99, 0, 0))

     


    to count students present use text label with formula:

     

     

    CountRows(Filter(Gallery.AllItems,Status="Present"))

     

     


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • jjanowskiRR Profile Picture
    58 on at

    This is very helpful - thank you!

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 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard