how to filter a reference variable based on the value in another variable on a record producer

patricklatella
Mega Sage

Hi all, 

I've got a record producer that has a reference variable "Practice" to table "u_practice".  I then have another reference variable "Work Engagement" to a table "work_engagement".  There is a column on the "work_engagement" table for "practice".  So what I need is, when the user selects the "Practice", the list of options for the "Work Engagement" field are only those records from the "work_engagement" table where the "practice" field is the same as the Practice that the user chose on the form.

I'm tinkering with a couple ways to do this, but is there an easy way to do this?  Thanks!

 

1 ACCEPTED SOLUTION

patricklatella
Mega Sage

turns out yes, very easy:

advanced reference qualifier on the "work_engagement" variable 

"u_practice" is the column on the [work_engagement] table

javascript:"u_practice="+current.variables.u_practice

View solution in original post

4 REPLIES 4

patricklatella
Mega Sage

turns out yes, very easy:

advanced reference qualifier on the "work_engagement" variable 

"u_practice" is the column on the [work_engagement] table

javascript:"u_practice="+current.variables.u_practice

Hello @patricklatella it worked exactly as required.
I had a similar requirement of filtering records based on other variable, but in the target table also i have 2 more fields with boolean values
javascript:"u_country_company_code="+current.variables.entity_id, this is the reference qualifier which works

I also need to show only values which are true based on one of the column
How can I achieve this
Table 
Values           A column          B column
Apple            Yes                     No
Orange          No                     yes

 

As of now I have achieved to show only the related values selected based on other variable, i also need to add a condition to show which is true for A column alone

 

I tried this below qualifier, but this returns every record, kindly provide your suggestion

javascript:"u_country_company_code="+current.variables.entity_id^a_column=true

 

 

Hi Gokul,

apologies for the delay, not sure if you figured out your solution.  But you could try building the query from the table view, and then replacing the part of the query that depends on your variable.  If that still doesn't work try:

 

javascript: "u_country_company_code="+current.variables.entity_id+'^a_column=true'

Amazing Solution ❤️