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 / Patch a all items from...
Power Apps
Answered

Patch a all items from a gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I have a gallery, where items one ordered is placed. All of the items should then be saved to the user which is selected in the dropdown. But how to I patch all the items into the same column to the selected person?

inventory1.PNG

 

The Strandard laptop ny and Screen 27" should end in the same row in that column under that person. 

 

inventory2.PNG

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 
    You must reference the gallery's fieldname in the 3rd argument of PATCH rather than Gallery3.AllItems.

    ForAll(Gallery3.Items,
     Patch(
     Items,
     LookUp('Overview Hardware', 'Name {Name})' = Dropdown.Selected.Value),
     {test: galleryfieldname}
     )
    )

     

     

    Next time please provide the text from your code.  It takes alot of effort to rewrite everything.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney  it does not work :S

     

    inventory3.PNG

    ClearCollect(Items,LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value, ThisRecord)); ForAll(Gallery3.Items,
     Patch(
     Items,
     LookUp('Overview Hardware', 'Name {Name})' = Dropdown.Selected.Value),
     {test: Gallery3.Title4}
     )
    )

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 
    This section of the code is wrong:

    {test: Gallery3.Title4}

     

    Is Title4 a label?  If yes, please tell me what code is inside the Text property of the label.  The fieldname inside the text property should replace Gallery3.Title4

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney  Yes it is a label and is given 

    ThisItem.HardwareType


    But putting that into the code does not work either. 

    ClearCollect(Items,LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value, ThisRecord)); ForAll(Gallery3.Items,
     Patch(
     Items,
     LookUp('Overview Hardware', 'Name {Name})' = Dropdown.Selected.Value),
     {test: Hardwaretype}
     )
    )

     

    inventory4.PNG

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 
    It appears there is a problem with this code.  I have no idea what it refers to but this is what needs fixing.

    'Name ({Name})'

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney  I fixed it but the problem is that it is only patching the first item in the gallery and not all of them,. 

     

     

    inventory5.PNG

    inventory56.PNG

     

    ClearCollect(Items,LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value, ThisRecord)); ForAll(Gallery3.AllItems,
     Patch(
     Items,
     LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value,
     {test: HardwareType}
     )
    ))
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 
    It looks like one of your brackets is missing

     

    ClearCollect(Items, LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value, ThisRecord));

    ForAll(Gallery3.AllItems,
        Patch(
            Items,
            LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value),
            {test: HardwareType}
        )
    )

     

     

    Also, a typical reason for only patching the 1st record is the criteria column in the LOOKUP function is not a unique value.

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     @mdevaney. There was missing a bracket..

    It still only patch the first item? How can I patch the whole gallery into that row, do you know? 🙂

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Solved it with

    ClearCollect(Items, LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value, ThisRecord));
    
     Patch(
     'Overview Hardware',
     LookUp('Overview Hardware', 'Name ({Name})' = Dropdown1.SelectedText.Value),
     {HardwareTypeGiven:Concat(
     Gallery3.AllItems,Title4.Text, ",")
     }
     )

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 842

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 402

Last 30 days Overall leaderboard