ref_qual_elements Variable Attribut ? UseCase

Meloper
Kilo Sage

Can someone please explain what you do with this attribute and what you need it for?

The text in the documentation does not help me.

The best thing would be an example of what I can reproduce.

Thank you very much and have a nice Christmas time

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Meloper 

Point below

Variable attribute ref_qual_elements is required because reference qualifier query should know the latest value of parent element/variable on which the qualifier depends for this variable.

Basically you are sending value to the server to get an updated reference values based on variable value passed

Consider with example

1) You have 1 variable which refers to Group Table reference type

2) You have list collector variable which refers to User table

So you want to use advanced reference qualifier on List collector to show only those Users belonging to the group selected

So you will have to set ref_qual_elements attribute for the list collector to make it identify that it is depending on the other variable

Also when you will be calling the script include from the Advanced ref qualifier you will have to send the Group Selected

So that would be helped by ref_qual_elements attribute

Another Example:

1) you have company variable referring to Company Table

2) You have User variable list collector to User table

You want to show only those users belonging to the Company Selected

So you will use that variable attribute and then in advanced ref qualifier do this

javascript: 'company=' + current.variables.user;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

11 REPLIES 11

You are welcome.

Happy learning

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Manmaya Sahoo
Kilo Contributor

Hi Ankur,

I have the use case for 'Group membership request ' where user can submit the request for a new group membership. When the requester changes on the form, the list collector should get refreshed and should only show the groups that the requester is not already a part of.

For that I have written one function inside a script include and have also set the ref_qualifier_elements value as the Requester.

But it only works when the form loads and changing the requester doesn't change the list collector options at all.

 

find_real_file.png

 

find_real_file.png

script include and function - 

find_real_file.png

Could you please help me with it?

 

Thanks in advance.