Notification

The AppSheet Help Center documentation can now be viewed in Japanese - AppSheet ヘルプセンターのドキュメントが日本語で表示できるようになりました。. Learn more

Conditionally require a column value (Required_If)

The Required_If column constraint may be used to require a column value of a row be present before the row may be saved. If a required column value is blank, the row cannot be saved.

Required_If is commonly used to enforce conditional input requirements, such as:

  • Requiring a signature if the balance is above a threshold.
  • Requiring a card number if paying with credit or debit.
  • Requiring completion of prerequisites first.

New to expressions and formulas? See also Expressions: The Essentials.

The Required_If expression

The Required_If column constraint is a Yes/No expression. If the expression evaluates as TRUE, the column value may not be blank; if FALSE, the column value may be blank.

As in all column constraint expressions, the Required_If expression may refer to the current column value using the column value expression, [_THIS]. For instance, if the current column is Employee Name, [Employee Name] and [_THIS] both refer to the same value.

Examples

([Subtotal] >= 20.0) - Require a signature if the subtotal is over $20.

IN([Payment Type], {"Credit Card", "Debit Card"}) - Require a card number if the chosen payment type is a credit or debit card. See also: IN()

ISNOTBLANK([Address Line 2]) - Require address line 1 if line 2 has been provided already. No address is fine, but if you provide line 2, you must provide line 1.  See also: ISNOTBLANK()

AND(ISBLANK([Home]), ISBLANK([Mobile]), ISBLANK([Work])) - Require at least one of the three phone numbers. See also: AND(), ISBLANK()

TRUE - Require always. Equivalent to setting Require? to ON.

FALSE - Never require. Equivalent to setting Require? to OFF.

Setting Required_If

To set a column's Required_If column constraint, go to the Data > Columns tab in the app editor and click on the edit icon next to the desired column:

Edit icon in the Columns page of the Data section.

Scroll down to locate (and, if necessary, expand) the Data Validity section, which contains the Require? setting. Clicking the flask icon to the right will replace the ON/OFF switch with an expression box.

Require? appears in Data Validity section. Click flask to toggle expression box.

 

Click in the expression box to enter your Required_If expression. To remove the Required_If column constraint, click the X to the right of the expression box.

Require? set to an expression in the Data Validity section.

 

Scope of Required_If

The Required_If column constraint is applied any time a row update is attempted, such as when the user interacts with a Form view or with a Quick Edit column (such as, in a Detail or Table view), when app formulas and initial values are applied, and when actions attempt a data-change operation.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

Search
Clear search
Close search
Main menu
17046263541494356785
true
Search Help Center
true
true
true
false
false