Re: Using the Button Element to update a record and then leave the field blank after

1472 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hi guys. I’m not very well versed with the jargon so I apologize in advanced.

So I want to use the record picker interface template as a score updater. I’ll do my best to explain what I want.

Each record points towards a player or participant. When a participant’s record is chosen one of the fields displayed is their current score. The score is used to “purchase” prizes, and they can come back multiple times to “purchase” prizes. So I want a field where we can enter the value of the prize, and when a button element is pressed, it deducts that value from the player’s score, and then becomes blank.

I understand there might be work that has to be done on the table itself to make it work maybe, but I’d appreciate any help with this problem.

3 Replies 3

Hi Forest, this is possible, but might be more complicated than we originally thought

So let’s say you’ve got that field where you enter the value of the prize set up, let’s call that field Prize Value.

We’ll need to do the following for set up:

  1. We create a new text field called Calculate new score
  2. In the Interface, we make a button and we make that it update the Calculate new score field to True when it’s clicked
  3. We create a new formula field called New calculated score, where the formula is:
{Player Score} - {Prize Value}
  1. We create an automation that will trigger when a record’s Calculate new score field is True AND its Prize Value field is not empty. Then we’ll make its action an Update Record action that will do the following:
    • Paste the New calculated score value into the Player Score field, thus deducting that value from the player’s score
    • Clear the Prize Value text field
    • Clear the Calculate new score text field

This should accomplish what you’re looking for I think!

I’m available to be hired to set it up in your base for you as well!

This might be doable another, more simple way and hopefully someone else chimes in with that, but this is the only way I could think of to work with the Interface I’m afraid

I think you meant the {Calculate new score} field to be a checkbox field, not a text field.

When running an au

Note that in the original use case, there is no good way to track the purchase history of a user. At most, the record history will show change to the number of points, but not the prize purchased.

Knowing the history of which prizes have been purchased can be useful in case of disputes, or even when a user is momentarily distracted in the middle of several transactions and doesn’t remember where he left off.

If you are interested in keeping track of the history of purchases, here are some options:

  • Use a linked record field to link to new prizes when they are purchased. If each prize has a fixed price, you can use rollups and formula fields to calculate the balance without having to use an automation or button.

  • Use a text field to enter the name of the prize being purchase. Have the automation append the points and the name of the prize to a long text field, in addition to copying the formula result and resetting the checkbox.

There are other variations on these options as well, depending on the needs of the situation.

Ooh, yes, a checkbox field would definitely be cleaner than a text field for this

Yeah, this would be ideal actually

Hmm, I reckon the above automation could be modified to handle this. Instead of doing an Update record action, we’d make a new table of Purchase History and make it create a record there, and link it directly back to the original user’s record and do the rollups and formulas you mentioned