Could someone explain this error to me, pleas...

Could someone explain this error to me, please? All referenced fields are base type text. Attempting to use this expression in a workflowโ€ฆ

Error msg: IFS function is used incorrectly:Inputs to IFS() must be condition-value pairs. Input 6 is not a value of a consistent type.

Expression: IFS([StructureID].[Insulator_Type]=โ€œPorcelainโ€,[PorcelainCondition], [StructureID].[Insulator_Type]=โ€œPolymerโ€,[PolymerCondition], [StructureID].[Insulator_Type]=โ€œPolymerAndPorcelainโ€,โ€œReplace All Insulatorsโ€)

0 18 833
18 REPLIES 18

@Levent_KULACOGLU Levent, thank you for the very through explanation however, it doesnโ€™t quite answer the question. Following either if your solutions, the user is presented with a list of options to choose from although, the user will only be able to choose ONE option and not multiple.

For example:

=IFS( CONTAINS([StructureID].[Material],โ€œWoodโ€),WoodCondition[WoodCondition], CONTAINS([StructureID].[Material],โ€œSteelโ€),SteelCondition[SteelCondition], CONTAINS([StructureID].[Material],โ€œConcreteโ€),ConcreteCondition[Concrete] )

If the structure material is Steel, the user should only choose one option pertaining to itโ€™s condition such as โ€˜Grade 1โ€™.

However, if the structure material is Wood, the user should be able to choose multiple options that pertain to the condition such as Wood Rot AND Cracking.

How can I enable selection if multiple options from the referenced list?

@Levent_KULACOGLU That is an approach I (obviously) never thought of.

Following your method of specifying TEXT type, the user is only able to choose one option. Is there a similar method that would allow multiple options to be choposen like ENUMLIST?

Try with:

CONCATENATE(โ€œReplace All Insulatorsโ€)

at the end.

IFS( [StructureID].[Insulator_Type]=โ€œPorcelainโ€,[PorcelainCondition], [StructureID].[Insulator_Type]=โ€œPolymerโ€,[PolymerCondition], [StructureID].[Insulator_Type]=โ€œPolymerAndPorcelainโ€, CONCATENATE (โ€œReplace All Insulatorsโ€) )

@Levent_KULACOGLU Perfectโ€ฆ Sorry I missed that earlier. Quick question semi-related to this issue if you have time:

I have several fields that are setup as Enums with valid_if references to other tables. I do this because depending on what is chosen in another field, I want the list of options to be different. So if user enters X in [THIS_FIELD] I want the emum list of options to be X_Options. If Y is chosen, the list of options to be Y_Options.

Unfortunately this often fails with the error that the chosen option cannot be converted to enum type. Any idea why that is or what I can do to workaround this?

@Michael

Provided you define a dropdown value with constructing an expression in Valid_if like TableName[ColumnName], you donโ€™t need to explicitly set the columnโ€™s type as ENUM. It will be better if you set them as TEXT and construct an IFS statement in Valid_if property like:

IFS( Condition1, TableName[ColumnA], Condition2, TableName[ColumnB], Condition3, TableName[ColumnC] )

@Michael

ENUM and ENUMLIST are way different. If you want to have multiple selection, then you have to explicitly choose the column type as ENUMLIST but can assign its values with Valid_if expression for sure.

@Michael

With ENUMLIST, your IFS statement condition should be set either by IN or CONTAINS expression provided you want to create a conditional content i.e.

IFS( IN(โ€œSomeTextโ€,[EnumlistColumnName]),TableName[ColumnA], . . )

OR

IFS( CONTAINS([EnumlistColumnName],โ€œSomeTextโ€),TableName[ColumnA], . . )

The bare difference between IN and CONTAINS is, IN looks for exact text inside a list, where CONTAINS looks for similar text

For example; think of a list of values like: {โ€œappleโ€ , โ€œbananaโ€ , โ€œkiwiโ€} in [FRUITS] column

IN(โ€œappleโ€, [FRUITS]) returns TRUE; where CONTAINS([FRUITS],โ€œappโ€) OR CONTAINS([FRUITS],โ€œappleโ€) also returns TRUE; however IN(โ€œappโ€,[FRUITS]) will return FALSE

@Michael as your base column type will be an ENUMLIST, you cannot change that column type dynamically as per a dependent selection or selected value.

But of course you can set 2 columns one for an ENUM and one for an ENUMLIST and then show/hide them as per selected value

@Levent_KULACOGLU Thank you Levent but the response is the same:

@Michael

StructureID, Insulation_Type, Polymer Condition, Porcelain Condition are all type of Text? Can you check and verify pls.? And pls check if the column that youโ€™re constructing this expression is also Text

@Levent_KULACOGLU Yes, I triple checked. StructureID is a reference to a text type field, The others are Enums with base types of text.

@Michael try with this:

IFS( TEXT([StructureID].[Insulator_Type])=โ€œPorcelainโ€,[PorcelainCondition], TEXT([StructureID].[Insulator_Type])=โ€œPolymerโ€,[PolymerCondition], TEXT([StructureID].[Insulator_Type])=โ€œPolymerAndPorcelainโ€, CONCATENATE (โ€œReplace All Insulatorsโ€) )

@Levent_KULACOGLU Same resultโ€ฆ

@Michael can you share your app with levent@able3ventures.com with co-author status so that I can check? And also please point me the table name, column to look at and which column you are trying to construct this expression. Itโ€™s hard to guess without seeing. Thnx.

@Levent_KULACOGLU I have added you to the app as a co-arthor. The expression would be used in a workflow so it isnโ€™t written in the table. But, it the field for which I need the value is in table Inspection.

In short, this table is for inspection of Structures. In the Structures table, the user states what type of insulators in installed, Polymer, Porcelain, or PolymerAndPorcelain. When inspecting the structure, the inspector must evaluate the condition of the insulator. Depending on whether the insulator is Polymer or Porcelain, this insulator condition is stored in the corresponding field.

If the insulator installed (Structures table) is PolymerAndPorcelain, we do not record a condition or the insulator and simply want the workflow report to state โ€œReplace All Insulatorsโ€.

@Michael the reason why your expression giving an error is because your [Porcelain Condition] and [Polymer Condition] columns types are ENUMLIST. ENUMLIST column types always produce a LIST. Therefore your expression shall be:

IFS( [StructureID].[Insulator_Type]=โ€œPorcelainโ€,LIST([PorcelainCondition]), [StructureID].[Insulator_Type]=โ€œPolymerโ€,LIST([PolymerCondition]), [StructureID].[Insulator_Type]=โ€œPolymerAndPorcelainโ€,{โ€œReplace All Insulatorsโ€} )

Top Labels in this Space