Dynamically swap weight entry field between LBS and KG?

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.

0 6 622
6 REPLIES 6

Steve
Platinum 4
Platinum 4

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?

https://www.appsheet.com/samples/How-to-go-to-a-view-based-on-the-users-form-submission?appGuidStrin...

It was staring me in the face! Thanks Steve!

Top Labels in this Space