Add a reference filter to field based on a condition

Aeden Frost
Tera Contributor

Hi all, 

 

I am trying to add a filter for a reference field that only activates when a condition is true on another table, however, I am unsure as to how to go about this. Any help at all would be greatly appreciated!

 

There is a choice field on [Table A] which has 3 options, if the choice is either one or two, I want to add a filter (state=active) to a reference field on [Table B]

 

1 ACCEPTED SOLUTION

TrevorK
Kilo Sage

I can think of a couple of ways to do this. The first way I would try to do this is by using an Advanced Reference Qualifier. For example, you can have a Reference Qualifier point to a Script Include like this:

TrevorK_0-1676867435565.png

 

Then in your script include, perform whatever logic you want:

TrevorK_1-1676867546571.png

 

If I understand your problem correctly, that you want to have a reference field apply a reference qualifier based on the value from another field, this should do the trick. 

 

You can also code straight in the Reference Qualifier. I'm not sure if that's officially poor practice, but pulling it out into a script include is much cleaner. Here is what that looks like:

TrevorK_2-1676867968623.png

View solution in original post

4 REPLIES 4

-O-
Kilo Patron
Kilo Patron

There is a choice field on [Table A] which has 3 options, if the choice is either one or two,

On which record of Table A - what is the link between records in Table A and records in Table B?

Omkar Ranjane
Tera Guru

Hi @Aeden Frost ,

 

You can create script include & with advance reference qualifier you can achieve it. You can pass the choice field value as parameter and based on that apply the query on 2nd table and return the values.

 

If your question is solved, please close the topic by marking my answer "Accept as Solution". This will help others searching for a similar question and will remove the topic from the unsolved list.

TrevorK
Kilo Sage

I can think of a couple of ways to do this. The first way I would try to do this is by using an Advanced Reference Qualifier. For example, you can have a Reference Qualifier point to a Script Include like this:

TrevorK_0-1676867435565.png

 

Then in your script include, perform whatever logic you want:

TrevorK_1-1676867546571.png

 

If I understand your problem correctly, that you want to have a reference field apply a reference qualifier based on the value from another field, this should do the trick. 

 

You can also code straight in the Reference Qualifier. I'm not sure if that's officially poor practice, but pulling it out into a script include is much cleaner. Here is what that looks like:

TrevorK_2-1676867968623.png

Coding straight into the Reference Qualifier worked like a charm, it's working perfectly now, thank you very much!