cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lparkerMDVIP
Level: Powered On

Increase / Decrease field in SharePoint

PointIncrementals.png

 

Hello Community!!

 

I have a SharePoint List with two fields (Employee Name, Points). In My PowerApps, I have an up(increase) arrow and down(decrease) arrow. When each of those arrows are pressed, I would like the Points field to increase or decrease in value. Lastly, I want the Update Points button update the Points field in SharePoint.

 

Any suggestions??!! 🙂 

2 REPLIES 2
datamaster
Level 8

Re: Increase / Decrease field in SharePoint

Hi @lparkerMDVIP did you try UpdateIF(sharpointlist,ID=thisitem.ID,{Points:Points + 1})

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

Super User
Super User

Re: Increase / Decrease field in SharePoint

@lparkerMDVIP 

The solution above will immediately update the database upon clicking the up or down arrows.  If you need a solution where the user must click "Update Points" instead I've proposed another solution below.  It will also work if the user decides to write-in the points. 

 

Step #1: Put this code in the OnVisible property of your screen to create a new collection

 

ClearCollect(employeePoints,your_datasource_name);

 

Step #2: Use the collection as the datasource for the gallery instead of your SharePoint table.  Use code in the Items property of your gallery

 

employeePoints

 

Step #3:  Add a Text Input (called TextInput1) toyour gallery to display the points.  Put this code in the Text property

 

ThisItem.Points

 

Step#4:  Make an up arrow icon and put this code in the OnSelect property.

 

Patch(employeePoints,ThisItem,{Points: Points + 1})

 

Step#5:  Make an down arrow icon and put this code in the OnSelect property.

 

Patch(employeePoints,ThisItem,{Points: Points - 1})

 

Step#6: Create a new button with the text Update Points.  Use this code in the OnSelect property of the button.

 

Patch(your_datasource_name,ThisItem,{Points: Value(TextInput1.Text)})

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,886)