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 / Power Apps: Error in P...
Power Apps
Unanswered

Power Apps: Error in Patch formula for updating quantity based on user input

(1) ShareShare
ReportReport
Posted on by 2

Hello everybody,

I’m building an app using Power Apps Studio, which is connected to a Microsoft List. The app was auto-generated, and I’ve made some modifications.

I’m trying to create a formula that allows me to update the quantity (Kolicina) of a specific item in the list based on an ID entered by the user. However, I keep running into issues, and I’d appreciate your help.

Here’s what I want to achieve:

  • A user enters an ID and a quantity to subtract.
  • The app finds the item with the corresponding ID in the list.
  • The app reduces the Kolicina field for that item by the entered quantity.

Here’s my formula:

Patch(
Offcut,
LookUp(Offcut, Ident = Value(Ident_DataCard2_1.Default)), // Find the item by ID
{ Kolicina: Kolicina - Value(Kolicina_DataCard2_1.Default) } // Update the quantity
)

Issues I’m facing:

  1. I sometimes get an error saying, "Incompatible types for comparison: text, number".
  2. Other times, I get an error like, "Invalid use of Text property", even though the controls seem to have the correct values.

Additional Details:

  • Offcut is the name of the list.
  • Ident is a column in the list (it’s supposed to be numeric).
  • Kolicina is a numeric column that stores the quantity.
  • Ident_DataCard2_1.Default is the user input for the ID.
  • Kolicina_DataCard2_1.Default is the user input for the quantity to subtract.

What I’ve tried:

  • Ensuring that Ident is numeric by using Value().
  • Using labels to display the values of Ident_DataCard2_1.Default and Kolicina_DataCard2_1.Default to debug.
  • Changing LookUp to directly match Ident without Value().

Questions:

  1. Is my formula structured correctly?
  2. How can I ensure compatibility between text and number types when comparing or updating values?
  3. Are there any debugging tips I can use to pinpoint where the issue is?

Any guidance would be greatly appreciated! 😊

Thank you in advance!

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at
    hey
     
     
    can u try this:
    Patch(
        Offcut,
        LookUp(Offcut, Ident = Value(Ident_DataCard2_1.Text)),
        { Kolicina: LookUp(Offcut, Ident = Value(Ident_DataCard2_1.Text)).Kolicina - Value(Kolicina_DataCard2_1.Text) }
    )
    
    If it helped please mark as verified answer
     
     
    cheers
  • NJ-17011247-0 Profile Picture
    2 on at
    @mmbr1606 Thank for your reply but this is not valid reply. 
     
    I still have a problem. 

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard