How to retrieve value from Number Inputs in a ListView on change

Heya! I'm new to Retool. So far so good, but I'm running into a problem that seems so basic that I'm afraid I'm just not approaching the right way. I've done a bit of digging online, but no luck yet so I'm posting here.

I'm building an app for users to allocate a certain amount of 'votes' to a list of options. Each option is a Number Input and when the user enters a value in the input field, I would like to deduct that number from their total number of votes.

UI looks like this:

So... my thought was to register an Change handler on the Number Input, grab the new value and update my temporary state.

I can't figure out how to grab this new value. I would expect there to be a data structure associated with the Change event, but I haven't found that in the docs. I see there is an event variable that is available, but it seems a little 'internal'. Similarly, there is self, but I loose the reference to the element that triggered the change.

What's the correct way to handle this?

Thanks for any help!

Hello there @porkchop (I should have taken this username when I had the chance).

So this is actually a lot simpler that you might think in Retool, you don't need to deal with events at all. You can just directly reference the values of those inputs in your text component. Something like:

You have {{ totalShares - numberInput1.value - numberInput2.value ... }} shares left to allocate before you can proceed.