Resetting a math column with custom action?

Hello! I am building a small game where you earn points (or lost them) for completing (or failing) tasks. However, I am getting stuck creating a custom action button in which an admin has the ability to reset their points.

Layout looks similar to this:

Username: (specific column)
Total Points (Math Column)
Graph (points gained data)
Graph (points lost data)
Reset button Custom: Set Column value… heres where I get lost. My math column for total points doesnt show. Only user specific columns are showing.

Is there a way to create a user specific column that reads my math column? What would be another solution to this where the admin can their profile 2. scroll and see progress and 3. at the bottom click reset points using a button?

A math column calculates a value. It doesn’t store any actual values, so there is nothing to reset or clear in a math column. Instead, you should be clearing any column that the math column uses to calculate your points.

1 Like

That makes sense, although the set values action button only is showing for profile. here’s the math

Math Column: 0+t+r-p (where t= lookup of points from tasks, r= lookup of points from rules, and p=lookup of points spent)

Since these lookups are from values from different tabs how would i set values using the action button when it only shows “this item”? Would I have to create a separate button on each tab (being tasks tab, rules tab, inventory (points spent) tab? is there a way to combine those together so 1 button would reset all 3?

Since I assume you already have single relations to the other tables (to get the lookup values), you should be able to perform a Set Column action through those relations to clear the values in the other tables.

So it sounds like I have to go to each specific tab to create a button specific for points to be reset. Therefore there would be 3 buttons that the admin would have to click by going through those tabs. Is there a way to condense those into 1 button press?

What I’m suggesting is with one button. It reaches through the relation to set the column value. You would need a custom action with three separate set column actions on that single button.

I’ll give that a try!

1 Like

okay still not working.

Creating custom action gives me this result:

If rel_tasks (is not empty)>If rel_fails (is not empty).>if rel_rules (is not empty
Set Column Values
column values still wont show any value im using for the numbers.
Is there a way to send math columns to input to user specific values? If I created a user specific value in the profile and called it points I could use that as my source to reset… however how would I get a changing number to input into that user specific column?

Okay I was able to halfway solve the problem. Using the above custom action I was able to use the relationships to set column values of a boolean to FALSE which would set a new if then statement.

If relationship is not empty then set custom values:
If boolean is TRUE button switches boolean to false.
If boolean equals false (new number column) =0.

The new problem is that in order to switch it back, the relationship would have to be empty. however i wouldnt know how to empty that relationship since it doesnt show on the set values. Any thoughts?

Essentially. If relationship is not empty clicking the button will reset points and relationship. Clicking it again would allow me to start adding points again

I could be wrong, but I don’t think you need to use an If statements in the custom action or set any sort of boolean values. I think you just need three Set Column actions that that Clear the numeric values in the related row or set them to zero.

Do you have a screenshot of your custom action and maybe the settings of one of the set column actions?

Alright. Semi solving the problem I created a second button which would just switch the boolean back to true to show the points that the current tasks completed are showing.

However, the goal is to reset not only the points, but also the tasks. Which will essentially create a daily (or whenever admin chooses) reset button. points and tasks cleared together from the profile tab.

Here are the results. While the number is reset the rel_tasks still exist. I dont have the option to clear those since they are on another tab.
points cleared tasks not

I think you are over-complicating it. Just so we don’t mess up what you have so far, do me a favor and create another button and create a new custom action. You don’t need an If statement, so if there is one, you can delete it. Now add a Set Column action. Instead of pointing it to ‘This Row’, set it to one of the relations. This should give you all the columns in that relation. Then set any columns with numbers to Clear. That should be all you need and you can do the same with the other relations as well.

following as instructed its not showing me any relationships except in if then statementsset column relationship not available

Are your relations set up as Single or Multiple relations? I assumed single, since it allowed you to use the Lookup value in a math column. Multiple relations wouldn’t normally allow that because they are arrays. Can you show the settings for one of your relation columns?

Would you be willing to share a copyable version of your app so I can take a look at how you have everything structured?