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
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (3,552)