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

Dynamic reference qualifier for variables of Service Catalog

Takuya Saito
Mega Contributor

I would like to use dynamic reference qualifier for variables of Service Catalog.

I create script in System definition > Script Includes. I can use the script as dynamic reference qualifier for column of Form. But I can't for variables of Service Catalog.

Can't dynamic reference qualifier be used for variables of Service Catalog ?

Variable or column is List and it refers sys_user. As I would like to use complicated condition filter, I would like to use dynamic reference qualifier.

Thank you.

1 ACCEPTED SOLUTION

Takuya Saito
Mega Contributor

The cause was my easy mistake...

I missed application scope.

I refer other application(e.g. scope is x_my_app) script from global application. My wrong qualifier was below.

javascript: new UserLookup().getUsers();

 

But correct qualifier was below.

javascript: new x_my_app.UserLookup().getUsers();

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

I user dynamic reference qualifiers for list collector variables often.  Your reference qualifier is similar/the same as on a list field, or any other reference field when you call a script include

javascript: new UserLookup().getUsers();

With this qualifier, your script include (with the Client callable box checked) must return a comma-separated list of sys_ids prefaced with 'sys_idIN'.  I usually push query result sys_ids into an array, then

return 'sys_idIN' + arr.join(',');

Keep in mind that this will filter the list collector left side on form load, so depending on the number of results, the list may still be loading after the rest of the form is displayed. 

Let me know if this still isn't working for you, or want another set of eyes on the script include.

Thank you for the answer.

I have resolved by other way. The cause was my easy mistake...

But your answer is very helpful for me.

 

Takuya Saito
Mega Contributor

The cause was my easy mistake...

I missed application scope.

I refer other application(e.g. scope is x_my_app) script from global application. My wrong qualifier was below.

javascript: new UserLookup().getUsers();

 

But correct qualifier was below.

javascript: new x_my_app.UserLookup().getUsers();