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 / ForAll and Patch Patch...
Power Apps
Unanswered

ForAll and Patch Patching Everything Together

(0) ShareShare
ReportReport
Posted on by 55
RenameColumns( 'Vehicles', "ID", "VID" ), Patch( 'Vehicles', LookUp( 'Vehicles', ID = VID ), { Location: TextInput1.Text, Notes: TextInput1_1.Text } ) )

 

Any ideas on how to do this properly? Thanks!

 

Hello,

I have a gallery that each item has 2 text boxes. Right now, I'm using a Patch formula, but it changes all of the items to that same value, instead of just changing that record's value. I only want the individual item that I change to change. 

 

 

 

For example, currently:

If I change the text in the "Location" text box for item 2, it changes the "Location" text box for all items to that value.

 

I want it to only change the "Location" text box for item 2. 

 

Right now the code is: 

 

ForAll( 
Categories:
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dsopshin ,

     

    You are using Location and Notes for all the records, can you tell me where it this stored or maybe screenshot of your screen?

    It's obvious that your textbox is inside a ForAll loop which will get the records and put the value, currently your value is static.

     

    Are these in Gallery? or Collection? 

  • dsopshin Profile Picture
    55 on at

    @Ethan_R 

    It is a gallery that is connected to a SharePoint list. The items property filters the list (the same list: Vehicles) based on a value. 

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dsopshin ,

     

    Can you try this, let me know if any errors while you hover over them

    ForAll(
     Gallery1.AllItems,
     With(
     {
     galleryRecord: ThisRecord,
     patchingRecord: LookUp('Vehicles',ID = ThisRecord[@ID])
     },
     Patch(
     'Vehicles',
     patchingRecord,
     {
     Location: galleryRecord[@TextInput1.Text],
     Notes: galleryRecord[@TextInput1_1.Text]
     }
     )
     )
    )

     

    Hope this helps

  • dsopshin Profile Picture
    55 on at

    I am getting an error that says: "Error when trying to retrieve data from the network: fetching items failed. Possible invalid string in filter query."

    The part that is giving the error is:

     

    LookUp('Vehicles',ID = ThisRecord[@ID])

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dsopshin ,

     

    Can you insert the ID field which is related to your Gallery?

    Instead of [@ID] is will be different column name or simply ThisRecord.<columnName>

     

    Please try these variations as well

     

  • dsopshin Profile Picture
    55 on at

    I've tried a few variations of that as well, and that's not working. 

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dsopshin ,

     

    I hope the Gallery is having datasource as Vehicles, right?

    Then ID is part of the Vehicles column I suppose.

    This you should get that, if not it may be some other column in your Gallery. 

    Try adding a label inside your gallery for testing purpose and use that column as reference.

  • dsopshin Profile Picture
    55 on at

    The label inside the gallery is "ThisItem.Title". The title column in the SharePoint list is "Vehicle", but "Vehicle" doesn't come up as an option and gives and error if I try to use it. 

    I have tried it several ways, and I still get an error each time I try to do it.  

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard