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.
Here's the SP List A that consists of "Display Name", "Username" for email and "Class Name".
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.
Here's the SP List B.
Thank you.
Solved! Go to Solution.
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,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
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,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
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,
Thank you.
Hi @NurSabrina24 ,
No, colAttendees is the collection that updated by the Check boxes. List A will only display in the Gallery.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
User | Count |
---|---|
160 | |
91 | |
68 | |
64 | |
63 |
User | Count |
---|---|
210 | |
157 | |
93 | |
81 | |
71 |