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 / Collecting ThisItem an...
Power Apps
Answered

Collecting ThisItem and and a DropDown Value is causing multiple lines in my Collection

(0) ShareShare
ReportReport
Posted on by 27

Hello,

 

I have a drop down on a gallery.  On Change of the drop down, I have the following formula:  Collect(CollectionName, ThisItem, {DropDownName: DropDownName.Selected.Value}).  When I look at my collection after a change, it is showing all of the attributes associated with ThisItem on one line and then a second line shows only the drop down selected value.  The ThisItem attributes are feeding in from a power bi report.  In the screenshot below, the 6 should be in the blank spot above.  RestockQty is the column name in my formula.  I wrote it generic above to be more clear.

 

Any help would be greatly appreciated.

 

Mike_54_0-1600093147917.png

 

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Mike_54 

     

    I am assuming that you have CollectionName in the Items property of the gallery. In case you want to modify the record, you need to update the expression to:

    Patch(CollectionName, ThisItem, {DropDownName: DropDownName.Selected.Value})

     

    Collect is used to only add new values and not update the existing ones.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Mike_54 Profile Picture
    27 on at

    Thank you for the reply!  I do have a separate gallery with CollectionName in the item property.  This gallery, however is showing the data coming in from power bi.  Then, the user selects a value in the drop down and it should add a row for that item with the new drop down qty to the collection.  So, the collection is blank before the user selects a drop down value.  Is that more clear?

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @Mike_54 

     

    In case, you want to collect only the dropdown selections, can you update the expression to: Collect(CollectionName, {DropDownName: DropDownName.Selected.Value})

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Mike_54 Profile Picture
    27 on at

    Thank you. 

     

    Ideally, I would be able to add all the info attached to the item to a row in my collection with the selection in the drop down.  If I change my formula to Collect(CollectionName,{Article: ThisItem.Article, RestockQty: DropDownName.Selected.Value}) then it will put them on the same row.  I have to spell out all the columns I want, but not a big deal.  The only issue now, is that I have multiple items and each has it's own drop down.  However, if I select the first item and a drop down value of 1, I see it correctly on my collection.  If I then select a second item's drop down and choose 2, it will add another row to my collection, but it will now show the selection of "2" on both rows.   How can I get the collection to show the selected value in the specific drop down associated to each item?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Mike_54 

     

    I used the same expression that you are using and I am able to get the required results. Can you confirm if you have any other expression that might affect the behaviour?

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Mike_54 Profile Picture
    27 on at

    You're right.  There were something off on the gallery where I was showing my collection.  Everything is working now.  Thank you!  I'll mark your answer as a solution.

     

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard