Data Validation when entering data

Hello,

I have a table that has a column named โ€œStatusโ€. The value for that column may only be โ€œOpenโ€ or โ€œClosedโ€.

There should be no more that one record in an โ€œOpenโ€ state.

How do I make it so that a user can only add a new record when all other records are in a โ€œClosedโ€ state?

Thanks in advance
Stel

Solved Solved
0 2 142
1 ACCEPTED SOLUTION

It sounds that you are basically looking for preventing duplicate occurrences in the [Status] column for one of the enum options Please take a look at the following articleโ€™s last section on avoiding duplicates.

In your case I believe since you wish one of the enum options only to be non duplicate, you could revise the expression something like below

IF([Order Status]=โ€œOpenโ€,
ISBLANK(
FILTER(
"Table Name",
โ€œOpenโ€= [Status]
) - LIST([_THISROW])
),
TRUE
)

View solution in original post

2 REPLIES 2

It sounds that you are basically looking for preventing duplicate occurrences in the [Status] column for one of the enum options Please take a look at the following articleโ€™s last section on avoiding duplicates.

In your case I believe since you wish one of the enum options only to be non duplicate, you could revise the expression something like below

IF([Order Status]=โ€œOpenโ€,
ISBLANK(
FILTER(
"Table Name",
โ€œOpenโ€= [Status]
) - LIST([_THISROW])
),
TRUE
)

Thanks. That worked well.

Top Labels in this Space