Q: Is it possible to dynamically swap weight entry field between LBS and KG?
I am trying to get a column backed text entry field for weight to dynamically swap between displaying, accepting and normalizing weight entries … past and present. I have a global weight units setting (LBS / KG) stored in a separate table column. I want to drive the weight_kg entry to dynamically change to whichever global setting was just applied. I am hoping for pseudo code like this to dynamically drive the [weight_value]
text entry field (and redisplay when [global_units]
changes) …
[weight_value]=IF([global_units]="LBS",[weight_kg]*2.2,[weight_kg])
… and pseudo code like this on entry processing …
[weight_kg]=IF([global_units]="LBS",[weight_value]/2.2,[weight_kg])
I can’t think of how to do this in AppSheet. Hoping to find out if anyone has encountered and addressed this problem before.
Have you considered a virtual column?
Yes, but my understanding is that a user can’t enter data into a virtual column, which is why I didn’t try to pursue this route. If I imagine this in a ReactJS context, I’d take care of the conversion for display in render()
and handle normalizing the units in a Submit button event handler. Is there something analogous in AppSheet?
I have no experience with ReactJS, but based on a quick googling, I’d say AppSheet has nothing even close to render().
You can attach actions to the form submission.
That sounds promising. I found this example AppSheet App called Dynamic Form Action. Is this what you’re thinking? What’s the AppSheet setting to attach actions to the form submission?
It was staring me in the face! Thanks Steve!
User | Count |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |