List Field Reference Qualifier Not Working

ican
Tera Contributor

Use Case:

I have a 2 List Fields (Field A & Field B)

Field B is dependent on Field A

Field B is referencing a table.

Reference qual: javascript: 'typeIN'+current.type;

Table:

NameType
OrangeFruit
Banana

Fruit

CarrotVegetable
CabbageVegetable

 

When I choose Fruit in Field A

Field B List was displaying correctly Orange & Banana

But When I choose Fruit & Vegetable in Field A

Field B List is displaying empty list/choice.

 

It is only working correctly when choosing 1 Type in Field A

But not working on multiple Types.

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@ican This is expected behavior from the reference qualifier as the Type column on your table is either Fruit or Vegetable and the query your qualifier returns is typeIN'+current.type; where current.type represents the type value chosen in Field A.

 

The query works fine when it finds a match for Fruit or Vegetable but when you choose Fruit and Vegetable the query becomes typeIN'+'Fruit and Vegetables'; and this query results in nothing as no such type exists.

 

You can use following qualifier to fix it.

 

javascript: if(current.type=='Fruit'||current.type=='Vegetable'){

return 'typeIN'+current.type;

}

else{

return 'type=Fruit^ORtype=Vegetable';

}

Hope this helps.

The query "'typeIN'+current.type" is equal to "Type is one of Vegetable, Fruit".

In Table Filter it is working fine wherein it displays records having type of Vegetable and Fruit altogether.

 

Also I cannot use the IF Else since the type has 88 choices,

So I have to use the IN operator or "is one of"

If the query is working in Table filter than it should work in reference qualifier too. I am assuming Field A is a choice field with following choices.

1. Fruit 

2. Vegetable

3. Fruit, Vegetable

 

Are the choices correct here or they are different in your setup?

Fild A is a List Field with the following choices:

1. Fruit

2. Vegetable

 

So when I Choose Fruit and Vegetable since I can choose multiple in a List Field,

Field B is not displaying anything.

Field B should display combined records of Fruit and Vegetable.