Hi Team,
I'm trying to create an app for parent and student attendance. This issue is when I select the first item in the dropdown, it applies to all others dropdowns in the gallery.
The flow is when the teacher marks the attendance by selecting yes or no from the dropdown, when clicking on the submit button, the status will change from "Not Started" to "Completed" and the dropdown and submit button will be greyed out.
On Submit Button
Patch(
'PTSI Attendance Records',
{
StudentName: studentNameLabel.Text,
Date: TakeAttendanceDatePicker.SelectedDate,
ParentAttendance: ParentAttDropdown.Selected.Value,
StudentAttendance: StudentATTDropdown.Selected.Value,
ClassName: ClassNameLabel1.Text,
TeacherName: ClassDropdown.Selected.Value,
Parentnameandmobile: ParentandMobileLabel.Text,
TimeSlot: TimeLabel.Text,
YearLevel: YealLevelLabel.Text,
Status: {Value: "Completed"}
}
);
Patch(
PTSI,
LookUp(PTSI,ID = ThisItem.ID),
{
Status: {Value: "Completed"
}
}
)
Dropdown is getting info from SharePoint List
Items - Choices(PTSI. ParentAttendance)
Name - ParentAttDropdown
Onchange - Set(ParentAttRecords, ParentAttDropdown.Selected.Value)
Default - ParentAttRecords
Any help is greatly appreciated. Thanks in advance
Regards,
Bryan
The workaround is to use the combo box instead of dropdown
Whatever you do here, you need to write the value of the drop-down as soon as it is changed into a field in the Items of the Gallery. This can be an added field (to a collection) or the actual data source - the option of saving it all at the end only works if you do not run anything from inside the gallery.
@WarrenBelz could you please break it down for me please, not sure what to do. Thank you
I'm updating the status from "Not Started" to "Completed" and it reset the dropdown value. At the moment I'm not using any collection and no code inside the gallery.
The only way you are going to do that is to have a field in your Gallery Items (if a Collection, use AddColumns) and then Patch to that field OnChange of the control, with the Default of the control referring to the field you have just changed. The issue is that a Gallery resets when anything is run from inside it, so you need to retain the value. If however you are not running any code from inside the gallery, each one should retain the value you selected.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi Warren,
@WarrenBelz Thank you for your prompt response. If I leave it blank, when I click on the submit button, the value in the dropdown will reset it back to default which is "No" in this case, as per attached. How to set the dropdown value as per user selected value. Thank you in advance.
Hi @BryanHuang888 ,
Your issue is here
Onchange - Set(ParentAttRecords, ParentAttDropdown.Selected.Value)
Default - ParentAttRecords
You cannot do this in a gallery of (as you have discovered), it changes every drop-down value. Just leave the Default blank and it should work.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2