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?