cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FureYang
Frequent Visitor

Power Apps Button to Update Sharepoint List item

what is the recommended ways to update an item in Microsoft List (a predefined number) by reducing it by X number for every Power App Button press.

 

let say i have 100 unit and every Button Press will reduce it by 1

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@FureYang use the Patch function. Patch(listName, recordToUpdate, {value:existingValue-1})

View solution in original post

14 REPLIES 14
CNT
Super User
Super User

@FureYang use the Patch function. Patch(listName, recordToUpdate, {value:existingValue-1})

FureYang
Frequent Visitor

Hi @CNT, Alright will try it out .... THX!

FureYang
Frequent Visitor

I have tried to edit as such:

OnSelect: fx= Patch(NumberControlTest,ThisItem.Quota,{Value:ThisItem.Quota-1})

 

But it seems that the formula have errors. likely defined incorrectly for "{Value:ThisItem.Quota-1}" part.

@FureYang can I see a screen shot with the error?

FureYang
Frequent Visitor

FureYang_0-1638265438929.png

The app is to update a Microsoft List item. So i was intended to make a button to update the Quota Column as I select the Button.

@FureYang I see only the red lines but not the Error Message! Hoover over the red line to see the error message. Also, what is the data type of the Quota column?

FureYang
Frequent Visitor

Sorry about that. 
Here is the error message: Invalid argument type (Number). Expecting a record value instead.

The Column is defined as a number by the way.

@FureYang The Value column in NumberControlTest is expecting a record. I'm not sure what is the structure of this? Can you provide all the details please?

FureYang
Frequent Visitor

Sure. I'm trying to create an App out of Microsoft List.
So the list looks as such:

FureYang_0-1638266401752.png

Then Integrate it to Power Apps.

FureYang_1-1638266530656.png

 

Then, from the Edit Form page, i am trying to insert a button for the Quota item to update its value.

FureYang_2-1638266593854.png

 



Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (3,541)