The CreatorCon Call for Content is officially open! Get started here.

Apply Reference Qualifier that filters results, depending on select box variable

GJones
Tera Contributor

Hi!

 

I'm trying to generate filtered results in my reference variable, depending on the value of a previous select box value on a catalogue item.

 

if select_box = X

apply "assigned_toISEMPTY" reference qualifier to reference_variable

 

I have a bunch of items that are to be assigned to users. If they select "New Assignment" on the cat item, then I do not want the users to be able to select an item, that is currently assigned to someone. Only unassigned items should appear. Is this possible?

 

 

1 ACCEPTED SOLUTION

Alex Rose
Tera Guru

I've been able to do this with a script include.  The script include would be a function looking something like this:

 

 

 

 

function exampleRefQual(){

    var encodedQuery = '^';

    if(current.variable.select_box == 'x')
    {
        encodedQuery = 'assigned_toISEMPTY';
    }

    return encodedQuery;

}

 

 

 

 

 

Then in the advanced reference qualifier for your reference variable, put 

 

 

javascript:exampleRefQual()

 

 

 

View solution in original post

1 REPLY 1

Alex Rose
Tera Guru

I've been able to do this with a script include.  The script include would be a function looking something like this:

 

 

 

 

function exampleRefQual(){

    var encodedQuery = '^';

    if(current.variable.select_box == 'x')
    {
        encodedQuery = 'assigned_toISEMPTY';
    }

    return encodedQuery;

}

 

 

 

 

 

Then in the advanced reference qualifier for your reference variable, put 

 

 

javascript:exampleRefQual()