web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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
    153,117 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
    153,117 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard