web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Collect items from gallery containing dropdown control

(0) ShareShare
ReportReport
Posted on by 36

Hello, 

 

I have a gallery that's created from a collection (Items property is set to a collection called c_approvers). However, I added a dropdown to the Gallery and set its Items to: Filter(Users, Role=ThisItem.appr_role), where Users is another table that contains two columns: Role, and Username. The idea here is to show the different usernames in the dropdown that have the same Role. I'm able to see the names of users when running the app. 

 

Problem: 

I created a button to collect the details of the gallery to another collection (myCollection) and used the following:  

 

Clear(myCollection);
ForAll(
Gallery.AllItems As item,
Collect(myCollection, {Index : item.Label33.Text, Approver: Dropdown5.Selected}
));

 

When I check the result I get the following: 

 

Approver          Index

[Record]           1

[Record]           2

[Record]           3

 

 

I need to get the name of the approver, not a record. Your advice is appreciated! thanks. 

 

 

I have the same question (0)
  • WarrenBelz Profile Picture
    151,757 Most Valuable Professional on at
    Re: Collect items from gallery containing dropdown control

    Hi @OmarSaleh ,
    Assuming Approver is a Person Field

    Clear(myCollection);
    ForAll(
     Gallery.AllItems As item,
     Collect(
     myCollection, 
     {
     Index : item.Label33.Text, 
     Approver: Dropdown5.Selected.DisplayName
     }
     )
    );

     

    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

  • OmarSaleh Profile Picture
    36 on at
    Re: Collect items from gallery containing dropdown control

    Thanks, @WarrenBelz for your response. Approver is not a Person field, it's a text (name) from a table that has the following columns: ID - Approver - Email - Role. There might be multiple approvers (names) having the same role, so the dropdown is added to select the relevant approver for the app user.
    The collection that's used to build the Gallery has only Index and Roles details. Hope this makes it clear to you. Please let me know if you need further explanation. 

  • OmarSaleh Profile Picture
    36 on at
    Re: Collect items from gallery containing dropdown control

    @WarrenBelz, I just changed the column name in the table from (Approver) to (ApproverName) to avoid confusion and tried to add it here: 

    Approver: Dropdown5.Selected.ApproverName

     

    But the collection now shows the same name repeated in all records although different names were selected for indexes 1 and 3. 

     

    1  Asif

    2  Asif

    3  Asif 

     

     

  • OmarSaleh Profile Picture
    36 on at
    Re: Collect items from gallery containing dropdown control

    @WarrenBelz , I think the name is repeated because this below statement is getting the name of the last clicked-on record in the Gallery.

    Dropdown5.Selected.ApproverName

     

    Look at the screenshot here, because Asif was the last name I selected, the record is highlighted and the name is repeated in the output collection. 

    OmarSaleh_0-1703381013349.png

  • Verified answer
    WarrenBelz Profile Picture
    151,757 Most Valuable Professional on at
    Re: Collect items from gallery containing dropdown control

    @OmarSaleh ,

    If the dropdown is in the gallery, you just need to add Item. to the front as in the line above.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard