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 / 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,963 Moderator 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard