Returning an empty LIST() in Valid_If auto-hides the field & bypasses Required_If!

I ran into a frustrating quirk today and wanted to share it—and see if anyone else has been caught by this.

Setup:
I have a [Licence Type] column. Its Valid_If uses a SWITCH() statement to generate a dynamic list of dropdown choices based on a selected [Server ID].

Valid If for Licence Type:
IF(
[User ID].[User Type] = “User”,
SWITCH(
[Server ID],
“dc03ba07”,
LIST(“Viewer”),
“0fc23e7c”,
LIST(“Editor”, “Viewer”),
“fdc6e5ff”,
LIST(),
LIST(“Owner”, “Editor”, “Viewer”)
),
LIST(“Owner”, “Editor”, “Viewer”)
)

For one specific server (Server ID: fdc6e5ff), the logic intentionally evaluates to LIST() (an empty list) because standard users shouldn’t have any valid license options for that server. The [Licence Type] column also has Required_If and Show_If checked.

Issue:
Instead of displaying an empty field and throwing a validation error, AppSheet auto-hides the column entirely.

Because the system hides it, it treats the field as “not applicable.” This completely bypasses the Required_If rule, allowing the user to save the form—resulting in a broken record with a blank [Licence Type].

2 Likes

A blank list in Valid_If is saying, "there are no valid values ". What, then, could the user put? Required_If is ignored in this condition because requiring a value when no value is allowed makes no sense. You’ll need to design around this behavior.

6 Likes

Makes sense! I ended up designing around the behavior by moving the restriction to the [User ID] column in the Licences table.

Here is the Valid_If that got me through:

AND(
[User ID].[Authentication Status] = “Authenticated”,
OR(
[Server ID] <> “fdc6e5ff”,
[User ID].[User Type] = “Superuser”
)
)

This directly returns an error for the restricted server (fdc6e5ff) and completely restricts the license from being created. Got it working!

3 Likes

Nice, well done!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.