Hi,

I’ve painted myself into a corner with **ValidIf**

My app uses the concept of **current** and **planned** cable routes / branches.

Current branches should always show in the survey form.

Current branch = [survey_branch_number]

Planned branches should only show in survey form when added via a LINKTOFORM action.

Planned branch = [branch_A_number] & [branch_B_number]

- LINKTOFORM brings the planned [branch_A_number] into the current [survey_branch_number]

```
LINKTOFORM(
"survey_Form",
"lcs", [lcs],
"select_cabinet_to_survey", [select_cabinet_to_survey],
"select_asset_type", [select_asset_type],
"asset_name", [branch_A_assets],
"survey_branch_number", [branch_A_number],
)
```

- The ValidIf I was using gave me a result of
**1, 2, 3, 4, 5**

```
SORT(
UNIQUE(
SELECT(survey[survey_branch_number], TRUE, TRUE), {1,2}
+SELECT(survey[branch_A_number], TRUE, TRUE) {2,3,4}
+SELECT(survey[branch_B_number], TRUE, TRUE) {5}
-LIST(0)
-LIST("")
)
)
```

- But I only want to see the current [survey_branch_number] in the form
- So I changed the ValidIf to give a result of
**1, 2**

```
SORT(
UNIQUE(
INTERSECT(
SELECT(survey[survey_branch_number], TRUE, TRUE), {1,2}
SELECT(survey[survey_branch_number], TRUE, TRUE) {1,2}
+SELECT(survey[branch_A_number], TRUE, TRUE) {2,3,4}
+SELECT(survey[branch_B_number], TRUE, TRUE) {5}
-LIST(0)
-LIST("")
)
)
)
```

- The problem now is LINKTOFORM throws an error when trying to add branch
**3**or**4**or**5**because the ValidIf has ‘concealed’ them!

- Is there a way to make my ValidIf a little ‘smarter’ so that it only shows items in [survey_branch_number] and then adapts to ‘see’ [branch_A_number] when the LINKTOFORM initiates a new form?

I hope that made sense?

Thanks in advance…

.

.

.

**survey table**

.

.

.

**survey form**