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 / Trying to Use a Patch ...
Power Apps
Answered

Trying to Use a Patch Function to Update A DataVerse Table Record

(0) ShareShare
ReportReport
Posted on by 6

I am trying to have an enroll button in my canvas app update the 'Remaining Seats' Column in my DataVerse table. 

Here is my code: 

 

ForAll(SelectedCourses, Patch('College Courses', LookUp('College Courses', 'Class Name' = ThisRecord.'Class Name'), {RemainingSeats : RemainingSeats - 1}))

 

The first time I reference RemainingSeats it is recognized, but the second time I get an error saying "Name isn't valid. 'RemainingSeats' isn't recognized. I don't know how to fix this. 

Screenshot 2023-09-23 171517.png

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,442 Super User 2025 Season 2 on at

    Hi,

     

    If you are trying to refence itself against itself (like in Sql) it doesn't work like that.  sorry :-(.

     

    At the moment you are doing that, it has no idea what you are referring too because the LookUp, is about getting a reference for the patch command, not for property values.

     

    You'd have to already have this value stored somewhere(variable, gallery.Selected, collection etc)

     

    Does SelectedCourses have it? If so, use it like your  'Class Name = ThisRecord.'Class Name',if not, then you would have to do a lookup in place of the 2nd RemainingSets


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • cfarrell0208 Profile Picture
    6 on at

    Thank you so much!!! It worked 😀

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 739 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 268

Last 30 days Overall leaderboard