ValidIf to prevent form from saving if another survey already exists

Evening…

ValidIf…???

I’d like to prevent my survey_Form saving if any asset in [asset_name] also exists in the survey table [asset_name] column. This is to prevent a new survey starting from this survey_Form if a survey already exists.

Two things to note:

  1. [asset_name] is an EnumList Ref Type that uses a ValidIf to produce it’s list from the asset table.

  2. When the survey_Form is saved an action extracts each name from [asset_name] and creates a new row for each in the survey table - so the survey table will always only have one name in [asset_name] even though it’s an EnumList in the form.
    .
    .
    .
    The [asset_name] ValidIf is already in use so the approach I’ve been trying is for a separate column [validate_this_survey] to have a ValidIf that says:

NOT(
   IN(
   ANY([asset_name]),

SELECT(
	survey[asset_name],
	AND(
    [LCS] = [_THISROW].[LCS],
    [select_cabinet_to_survey] = [_THISROW].[select_cabinet_to_survey]
    ))
    )
    )

.
I’m trying to force an error if any asset in [asset_name] also exists in the survey table but I’m failing.

Any assistance would be greatly appreciated.

Thanks…
.
.

survey_Form

survey table

0 9 828
9 REPLIES 9
Top Labels in this Space