3 Condition in valid if

Hello guys

I have 3 columns
1- Administration No (Number) initial value (+1)
2- Administration (Enum)
3- manager (Enum)

I want write expression in valid if for column 2- Administration

What I want is

  • If i want to add a new record, it allows a new administration only and not allow to choose from the previously added.

  • if i want edit one of the previously added only allowe for new name that is not the same as the one previously added.

  • when i edit the record to edit the manager column It allows me to save the record without changing the administration column.

I hope you can help me

thank you

Valid If - What formula to use to only allow unique values Questions

We want to restrict the ability to add a value in a field, if that value is already in the field. i.e. we want to replicate the way Appsheet will restrict duplicate values in a “key” field But, we use a different “key field”. I tried making this other field also a"key", but after saving it was deselected. So appears can only have 1 key. I know IF and COUNT should be able to be used, but not sure how to… Thanks!

Pls check whether this helps @salehej

In the below, replace table with the name of the table.

salehej:

1- Administration No (Number) initial value (+1)

Administration No

  • Initial value: (MAX(table[Administration No]) + 1)
  • Editable?: FALSE

salehej:

  • If i want to add a new record, it allows a new administration only and not allow to choose from the previously added.> - if i want edit one of the previously added only allowe for new name that is not the same as the one previously added.

Administration

  • Valid If:

    ISBLANK(
      FILTER(
        "table",
        AND(
          ([_THISROW].[Administration] = [Administration]),
          ([_THISROW].[_ROWNUMBER] <> [_ROWNUMBER])
        )
      )
    )
    
    

salehej:

  • when i edit the record to edit the manager column It allows me to save the record without changing the administration column.

The approach to use here depends on how you want/intend to allow the user to edit the manager column.

1 Like

Thanks Steve

1 Like