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 / change the value of Te...
Power Apps
Answered

change the value of Textinput

(0) ShareShare
ReportReport
Posted on by 122

I have textinput in the Quantity column like this:

Edward00_0-1689487904666.png

I want that when I change the value in textinput, I will save it to colAddCart, and if the value of textinput is greater than the available quantity in Sharepoint List Product, I will update the value of the available quantity and display the message. Here's the formula I used to solve the problem that wasn't.

Edward00_1-1689488079248.png

Edward00_3-1689488092931.png

Collection:

Edward00_4-1689488199831.png

and the Product column will be associated with the SharePoint List Product:

Edward00_5-1689488264925.png

Hope everyone helps me solve this problem. Thank you so much.

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Edward00,

     

    As I understand it, you would like to change the selected quantity to the max. amount available should the textinput be higher than the actual availability in your list?

     

    I will use the Patch function instead of Update since this allows us to only add the fields that need to be updated. (removing the need to add Product & Size).

    If(
     IsBlank(tempcart),
     //Should the tempcart be empty, show an error here
     Notify("The selected item is invalid, please try again.", NotificationType.Error),
     //In case it is not empty, check the quantity
     ThisItem.QTY > ThisItem.Product.Quantity,
     //Update with the max. available quantity
     Patch(
     colAddCart,
     tempcart,
     {
     QTY: ThisItem.Product.Quantity,
     TotalPrice: ThisItem.Product.Quantity * varAddCart.Price
     }
     ),
     //Use the TextInput quantity
     Patch(
     colAddCart,
     tempcart,
     {
     QTY: Value(Self.Text),
     TotalPrice: Value(Self.Text) * varAddCart.Price
     }
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard