Skip to main content
Community site session details

Community site session details

Session Id : 1OpPXQ7g7u6AwvTPpuUnkp
Power Apps - Building Power Apps
Answered

Selecting a drop down list in the gallery apply to all the items in the dropdwon.

Like (0) ShareShare
ReportReport
Posted on 10 Jul 2023 13:51:42 by 11

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

  • BryanHuang888 Profile Picture
    11 on 12 Jul 2023 at 10:46:23
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    The workaround is to use the combo box instead of dropdown

  • Verified answer
    WarrenBelz Profile Picture
    148,894 Most Valuable Professional on 11 Jul 2023 at 04:09:50
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    @BryanHuang888 ,

    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.

  • BryanHuang888 Profile Picture
    11 on 11 Jul 2023 at 03:50:52
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    @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.  

  • WarrenBelz Profile Picture
    148,894 Most Valuable Professional on 10 Jul 2023 at 23:15:20
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    @BryanHuang888 ,

    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

     

     

     

     

  • BryanHuang888 Profile Picture
    11 on 10 Jul 2023 at 22:51:06
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    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. 

  • WarrenBelz Profile Picture
    148,894 Most Valuable Professional on 10 Jul 2023 at 21:27:51
    Re: Selecting a drop down list in the gallery apply to all the items in the dropdwon.

    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

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete