Invalid Constraint Error

Hi. I am trying to implement some logic based on the value of a column [Data Capture Type]. If the value of this column is “By Dependent Dropdown” it brings the user through a collection of drop down lists in order to set the value of the [Product Code]. If the value of the [Data Capture Type] column is “By Product Code” the [Product Code] column is populated with the entire list of Product Codes from the Product_Master_File table and based on the users selection it automatically sets the values of the dependent drop downs mention above.

I have the UX setup to compliment the above navigation but I cannot seem to get the logic to work.

I have the following Valid If expression in the [Product Code] column
IFS([Data Capture Type]=“By Product Code”,
SELECT(Product_Master_File[Product Code],TRUE,TRUE),
[Data Capture Type]=“By Dependent Drop Down”,
SELECT(Product_Master_File[Product Code],AND([Product Range]=[_THISROW].[Product Range],[Treatment]=[_THISROW].[Treatment],[Style / Length]=[_THISROW].[Style / Length],[Product Description]=[_THISROW].[Product Description]))
)

and I have the following Valid If expression in the [Product Range] Column i.e. one of the dependent drop downs.
IFS(
[Data Capture Type]=“By Product Code”,
ANY(SELECT(Product_Master_File[Product Range],[Product Code]=[_THISROW].[Product Code])),
[Data Capture Type]=“By Dependent Dropdown”,
SELECT(Product_Master_File[Product Range],TRUE,TRUE),
)

but I am getting the following error
Column Name ‘Product Range’ in Schema ‘Works_Orders_Master_Schema’ of Column Type ‘Enum’ has an invalid data validation constraint ’

Could anyone advise me on the best way to achieve my requirements?

Many thanks.

Make sure your Enum and/or EnumList columns have all possible values explicitly defined, OR make sure Allow other values is ON.

If your spreadsheet column has data validation enabled for it, make sure it will allow all possible values, OR remove the data validation. Generally speaking, you shouldn’t be doing data validation with both the app and data store: best to do it with the app only.

1 Like

This expression is invalid: the first branch ([Data Capture Type]=“By Product Code”) produces a singular value, but the second branch ([Data Capture Type]=“By Dependent Dropdown”) returns a list of values. Both must be singular values, or both must be lists; you can’t mix them.

Thank you for your help @Steve.

1 Like