Basic error (Valid If) Action Failed!

Evening all,

Iโ€™m having some finger trouble with a Valid If expression in a [survey_status] Enum (Text) column which refers to another column [final_survey].

The [survey_status] Valid If says:

IFS(

    [final_survey] = "Yes",
	LIST("In Progress", "On Hold", "Aborted", "Completed"),
    
    [final_survey] = "No",
    LIST("In Progress", "On Hold", "Aborted")
    
	)

.
The survey form correctly displays [final_survey] = โ€œNoโ€ with 3 [survey_status] options.
3X_5_7_5730f68f36b36cd149d50b0e65950f5be98b8e1a.png
.
.
and correctly displays [final_survey] = โ€œYesโ€ with 4 [survey_status] options.
3X_f_2_f2466f929db881fe86b46f9223d0462d4804ba9e.png
.
.
But if I select โ€œYesโ€ + โ€œCompletedโ€ and save, I get this error:


.
.
I know Iโ€™m doing something simple wrong but canโ€™t find what it is?

Thanksโ€ฆ

Solved Solved
0 16 424
1 ACCEPTED SOLUTION

Hi @Steve,

Thanksโ€ฆ The penny finally droppedโ€ฆ

I can see now that the action was failing because (other rows in the table - not the survey form row) did not have a โ€œYesโ€ in [final_survey] and that is what the [survey_status] Valid If was looking forโ€ฆ

Iโ€™ve resolved the issue by keeping [final_survey] in play with [survey_status] Valid If:

SWITCH(
		
    [final_survey],
    
    "Yes", LIST("In Progress", "On Hold", "Aborted", "Completed"),
    
    "No", LIST("In Progress", "On Hold", "Aborted"),
    
    LIST("In Progress", "On Hold", "Aborted")
    
    )

.
.
and updating the action:


.
.
Many thanks for the guidanceโ€ฆ Another light has come onโ€ฆ!!!

View solution in original post

16 REPLIES 16

Steve
Platinum 4
Platinum 4

What is the action doing?

Hi @Steve,

Thanks for coming inโ€ฆ

This is the action:

And this is itโ€™s reference rows expression:

IFS(

AND(

LOOKUP(
MAX(
SELECT(
		survey[_ROWNUMBER],
		AND(
		[survey_type] = "Cable",
		[LCS] = [lcs],
		[select_cabinet_to_survey] = [select_cabinet_to_survey],
		[select_asset_type] = [select_asset_type],
        [_THISROW].[asset_name] = [asset_name]
		))),
        "survey", "_ROWNUMBER", "survey_status"
        ) = "Completed",

COUNT(
SELECT(
		survey[_ROWNUMBER],
		AND(
		[_THISROW].[survey_type] = "Cable",
		[_THISROW].[LCS] = [lcs],
		[_THISROW].[select_cabinet_to_survey] = [select_cabinet_to_survey],
		[_THISROW].[select_asset_type] = [select_asset_type],
        [_THISROW].[asset_name] = [asset_name],
		[_THISROW].[survey_status] = "On Hold"
        ))) = 0
    
        ),

SELECT(
		survey[id],
		AND(
		[survey_type] = "Cable",
		[LCS] = [lcs],
		[select_cabinet_to_survey] = [select_cabinet_to_survey],
		[select_asset_type] = [select_asset_type],
        [_THISROW].[asset_name] = [asset_name],
        ISBLANK([branch_info]),
        OR(
        [survey_status] = "Completed",
        [survey_status] = "In Progress"
        )))
    
        )

I suspect that the problem is not with the action because it works OK if I simplify the Valid If to just a basic list that does not include the [final_survey] column. So this works:

LIST("In Progress", "On Hold", "Aborted", "Completed")

Does that help?

What does this action do?

3X_d_2_d2c0bb3b53e471da7a2b213f8a63f3bdbf0b572a.png

I would guess one of the rows doesnโ€™t have [final_survey] = "Yes".

Correctโ€ฆ Of n surveys, only the final one will have [final_survey] = โ€œYesโ€

That explains why it works with just a list and no reference to [final_survey]

The STATUS: Change to Completed (ROW) is setting survey_status for all related survey rows, yes? Do all of them have final_survey set to Yes, as required to allow survey_status to be set to Completed?

Correct.

Noโ€ฆ It depends on status is not โ€œOn Holdโ€

I think I see where youโ€™re going with thisโ€ฆ Iโ€™m using [final_survey] as a prompt and active confirmation from the surveyor before they proceed and fire the action.

I think Iโ€™m OK with the action itself as it is - not referring to [final_survey]

Are you?

3X_0_3_0327fe36eafbd56637abb84d7f8ac74402db7724.png

Good pointโ€ฆ

Hi @Steve,

Thanksโ€ฆ The penny finally droppedโ€ฆ

I can see now that the action was failing because (other rows in the table - not the survey form row) did not have a โ€œYesโ€ in [final_survey] and that is what the [survey_status] Valid If was looking forโ€ฆ

Iโ€™ve resolved the issue by keeping [final_survey] in play with [survey_status] Valid If:

SWITCH(
		
    [final_survey],
    
    "Yes", LIST("In Progress", "On Hold", "Aborted", "Completed"),
    
    "No", LIST("In Progress", "On Hold", "Aborted"),
    
    LIST("In Progress", "On Hold", "Aborted")
    
    )

.
.
and updating the action:


.
.
Many thanks for the guidanceโ€ฆ Another light has come onโ€ฆ!!!

Well done!

My intention with introducing [final_survey] was to have a way to hide the โ€œCompletedโ€ option from the surveyor until they actively say โ€œYesโ€ this is the final survey. This should reduce the possibility of accidentally firing the action?

Should I look at changing how I present the options to the surveyor?

@Steveโ€ฆ Youโ€™ve made me think of something that Iโ€™m going to tryโ€ฆ

Iโ€™ll revert to a simple list for [survey_status] that has all four options in it and have no reference to [final_survey] in the expression.

LIST("In Progress", "On Hold", "Aborted", "Completed")

Iโ€™ll move the [final_survey] reference into the action: STATUS: Change to Completed (ROWS) insteadโ€ฆ?

Actuallyโ€ฆI donโ€™t think thatโ€™s going to work becauseโ€ฆ

Iโ€™ll sleep on it and report back tomorrowโ€ฆ Thanks @Steveโ€ฆ

Top Labels in this Space