Need Help with Form and show_if()

Hi Friends

I have a a table and form from that table for input.

I have a ref table [Tank or Gauge Name] and I am using buttons to show them in the form. All the code is based on selection of the [Tank or Gauge Name]

ABBA_1-1657313919257.png

When I click the selection a drop down of [Tank of Guage ID] drops

ABBA_2-1657314096983.png

I dont want this to be dropdown but rather an auto SELECTTION process in the app, because each [Tank or Gauge Name] has a specific [Tank or Guage ID]

Also, since the code is based on [Tank or Gauge Name] or [_ThisRow], I have to have [Tank or Gauge Name] as selection, when the users prefer [Tank or Gauge ID]. 

is it possible to change something in the table where I dont have to change all the 25 to 30 formulas to [Tank or Gauge ID] but rather have users select [Tank or Gauge Name] and this action auto selects the corresponding [Tank or Gauge ID]?

ABBA_0-1657313833842.png

I have a table [Tank Gauge List] that I am using as reference to get [Tank or Guage Name]-column Tank or Guage Name

IDFacilityTank or Gauge NameTank#TypeCapacitybbls/in
EARL Harlan-11978EARL Harlan11978Production TankOil3001.167
EAST Dome Ellis-25293EAST Dome Ellis25293Production TankOil3001.167
EAST Dome Ellis-66018EAST Dome Ellis66018Sales TankOil3001.167
MOSBY Dome Ellis-11955MOSBY Dome Ellis11955Production TankOil3001.167
MOSBY Dome Ellis-Sales Tank #1MOSBY Dome EllisSales Tank #1Sales TankOil3001.167
Unit#1-1230Unit#11230Production TankOil3001.167
Unit#1-1231Unit#11231Production TankOil3001.167
Unit#1-55769Unit#155769Production TankOil3001.167
Unit#2-21469Unit#221469Production TankOil3001.167

Also I have another table called [Tank Guage Capacity] from which I get [Tank or Guage Name] as Unique([Tank Guage Capacity].[Tank or Guage ID-Name])

ABBA_0-1657316365651.png

I know the code is jumbled

I am trying to simpli

Solved Solved
0 7 173
1 ACCEPTED SOLUTION

Hi Friend.

This solved the problem with auto selection. Now the user does not have to select from drop down. Its auto selected.

I did change to initial value as sugested

[Tank or Gauge Name].[ID]

View solution in original post

7 REPLIES 7

use next formula  "[Tank or Gauge Name].[Tank or Gauge ID]"

Where would you use the formula @volodymyrt and what should be changed? Appreciate your input

i don't remember proper name for this, but when you have ref field you can use "." to get to some columns in it 

Screen Shot 2022-07-08 at 5.28.12 PM.pnghere

Hi Friend.

This solved the problem with auto selection. Now the user does not have to select from drop down. Its auto selected.

I did change to initial value as sugested

[Tank or Gauge Name].[ID]

if you wouldn't like that user will be able to change the Tank ID you shod use App formulas instead of Initial values, please read this article 

https://support.google.com/appsheet/answer/10106437?hl=en

App formulas and Initial values

Sometimes you want calculations to run in the app while the user is interacting with the data in a form. To help you achieve that goal, you can specify an App formula for specific columns. An App formula is an expression that AppSheet evaluates whenever a user changes a value in a form (while creating a new record or editing an existing record).

Each time such a change occurs in the form, the App Formula of every affected column in the record is evaluated and the column is assigned the result of the formula evaluation. For example, if a record has a Price column and a Tax column, the Tax column might have an App Formula [Price]*0.05 to compute a 5% tax automatically.

You can also specify an Initial value for every column. An Initial value expression assigns an initial or default values for a column in a new entry. If the expression is not a constant, it may be a formula that depends on other columns in the new entry. Its value will be recomputed as the new entry is filled in until the user explicitly sets the value of the column. At that point, a value has been assigned and the Initial value definition is no longer relevant for this entry.

In other words, an Initial value expression acts just like an App formula, but it has two differences: (a) the column is still editable by the user, and (b) once edited, the column is no longer automatically updated with continued re-computation of the expression.

https://support.google.com/appsheet/answer/10106437?hl=en 

Top Labels in this Space