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 / Display SP List A in P...
Power Apps
Answered

Display SP List A in PowerApps Gallery to Submit into SP List B

(0) ShareShare
ReportReport
Posted on by 165

Hi, 

 

I am creating an attendance app that use gallery to display rows of data from a sharepoint list (Let's say, it's a SP List A). In the gallery, I'd included label of "Display Name" and "Class Name" and checkbox for each name to be selected. I have 2 buttons of "Presence"  and "Absence" where teachers will tick checkbox for each student name and click the either one of the buttons which if selected students are those who present, teacher will click "Presence" button. So after teacher clicked the button, I want it to be submitted to another SP List for attendance checklist (SP List B). 

 

Could someone please help me on this? Thank you. 

 

NurSabrina24_1-1656051531370.png

Here's the SP List A that consists of "Display Name", "Username" for email and "Class Name". 

 

NurSabrina24_2-1656051599166.png

Here's the Gallery to display name list from SP List A which the name is from "Display Name" and "Class Name" hidden label and checkbox. 

 

 

NurSabrina24_0-1656051445197.png

Here's the SP List B.

 

Thank you. 

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @NurSabrina24 ,

     

    For the Check boxes in the Gallery, you need to append collections on OnCheck and OnUncheck properties in order to collect the checked items of list A, and for the two buttons, you shall leverage the Patch function to add new rows to list B (or RemoveIf function to delete rows) based on the collection.

     

    OnCheck:

    Collect(colAttendees, ThisItem)

    OnUncheck:

    Remove(colAttendees, ThisItem)

    OnSelect of Absence:

    ForAll(colAttendees, RemoveIf(ListB, DisplayName = ThisRecord.DisplayName))

    OnSelect of Presence:

    ForAll(colAttendees, Patch(ListB, Defaults(ListB),{DisplayName: ThisRecord.DisplayName, ......}))

     

    Hope this helps.

     

    Best regards,

  • NurSabrina24 Profile Picture
    165 on at

    Hi, 

     

    Do you know how if I want to declare that if the teacher click the 'Presence' button, in the list B will update to presence value?

     

    I've tried: 

    ForAll(PER, Patch('SEMINDA ... Checklist', Defaults('SEMINDA ... Checklist'), {'Presence/Absence': "Presence", 'Student Name': ThisRecord.'Display name', 'Class Name': ThisRecord.'Class Name'}))

    so here's my OnSelect for 'Presence' button. From the word Patch to the last ')' is error.

     

    Do you think there is any mistakes I'd made? colAttendees is the listA name, right? 

     

    so for mine are, 

    • colAttendees = listA = PER
    • listB = SEMINDA .... Checklist

     

    Thank you. 

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @NurSabrina24 ,

     

    No, colAttendees is the collection that updated by the Check boxes. List A will only display in the Gallery.

     

    Best regards,

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 528

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard