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

Notifications

Announcements

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

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,989 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
    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,989 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
    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,989 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
    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,989 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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard