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 Single Item From...
Power Apps
Answered

Patch Single Item From Gallery

(0) ShareShare
ReportReport
Posted on by 103

I am building an inventory tracker, and from my admins page I want to be able to update the status of a reservation. I have a gallery that shows all of my reservations, and within that gallery I have a comments input field, a status drop down, and an update button.

 

I've searched and found a couple solutions, but neither will work for me. I get the error:

 

"Network error when using the Patch function. The requested operation is invalid."

 

Since my button is within my gallery, I am using:

Patch('datasource',{ID:ThisItem.ID},{Comments:comments,Status:'status-dropdown'.SelectedText})

 

I have also tried:

Patch('DPI Mifi Request',{ID:Gallery.Selected.ID},{Comments:comments,Status:'status-dropdown'.SelectedText})

 

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @wwmn ,

     

    Try:

     

    Patch('datasource',ThisItem,{Comments:comments,Status:'status-dropdown'.Selected.Value})
  • mmollet Profile Picture
    3,187 on at

    Try the following:

    Patch('datasource', LookUp('datasource', ID = ThisItem.ID), {**same as you have here**});

  • mmollet Profile Picture
    3,187 on at

    We are synced up answering questions today it seems xD 

  • Verified answer
    wwmn Profile Picture
    103 on at

    I figured it out. I had to use variables instead of the data directly from the fields, along with @BCBuizer ThisItem suggestion.

     

    Patch('DPI Mifi Request', ThisItem, {Comments:varAdminComment,Status:varAdminStatus})

     

     

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @wwmn ,

     

    Using variables is a way to go, but from a maintainability point of view direct references are preferred: when you open up the app in a year from now you will not remember how these variables work.

     

    In case comments and 'status-dropdown' are both inside the gallery as well, the formula for the patch will look like:

     

    Patch(
     'DPI Mifi Request',
     ThisItem,
     {
     Comments:ThisItem.comments,
     Status:ThisItem.'status-dropdown'.Selected.Value
     }
    )

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard