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 Apps
Answered

Total points

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, 

 

I'm building a Power App where there is a list of activities worth different points and users can click buttons to add and remove an activity depending on whether they've done it and it will total their points. 

 

I have a SharePoint list called 'GoGreenActivities' with a list of activities and corresponding points. 

 

I have put in this formula into the 'OnSelect' of the Add button: 

UpdateContext({Total:Total + Value(LookUp('GoGreenActivities',Title="ThisItem.Title",Points))})

 

and this formula into the 'OnSelect' of the Remove button: 

UpdateContext({Total:Total - Value(LookUp(GoGreenActivities,Title="ThisItem.Title",Points))})

 

Then I have just a text label that says 'Total' and according to this doc Using this doc: Button control: reference - Power Apps | Microsoft Docs  when the buttons are pressed it should work but it doesn't. If I just put UpdateContext({Total:Total + Value(1)}) for example, it does work and the total box adds and removes 1 but it seems to have trouble looking up the point value from my SP list. 

 

Can anyone help? 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,559 Most Valuable Professional on at

    Hi @BT168 ,

    Is your Points field in GoGreenActivities a Numeric field - if so you should just need this

    With(
     { 
     wPoints:
     LookUp(
     GoGreenActivities,
     Title=ThisItem.Title
     ).Points
     },
     UpdateContext(
     {Total:Total - wPoints}
     )
    )
     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    155,559 Most Valuable Professional on at

    Hi @BT168 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard