Need help with Reference qualifier on Catalog Item Variable

GaryJHayes
Tera Guru

find_real_file.png

Hi,

I am trying to set a Lookup select box to work with a dependant field.

The dependant field is called current.variables.request_source. (Possible values: internal/external)

This does a direct lookup from the Choices list of the backend table

The reference qualifier I am using is:

javascript: "name=u_XXX_access^inactive=false^element=u_work_type^dependent_value=" + current.variables.request_source + "^EQ"

This works correctly and exactly as expected in the Service Portal but in the Platform UI Service Catalog the menu is always empty

As a test I tried replacing the variable with a fixed string like this:

javascript: "name=u_XXX_access^inactive=false^element=u_work_type^dependent_value=" + 'internal' + "^EQ"

 Then it work in both Service Portal and Platform UI Service Catalog (but obviously is not dependant)

Anyone have any suggestions why this qualifier is not working in the Platform UI Service Catalog?

1 ACCEPTED SOLUTION

GaryJHayes
Tera Guru

OK, so I figured out the answer myself and here are the details for anyone else who has this problem

While this technique works well of the Catalog Item when viewed from the Service Portal it needs to have additional configuration to make it work properly when accessing the Catalog Item from the Platform UI Service Catalog

On the Default Value tab(!) there is a Variable Attributes field and this needs:

ref_qual_elements=<variable used to filter>

In this instance:

ref_qual_elements=request_source 

Which matches the "current.variables.request_source" specified in the 'Reference qual'

With this in place the filters work in the Request Item in both the Service Portal and Platform UI Service Catalog

View solution in original post

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Gary,

Can you try this; use toString()

also is the variable name correct request_source; did you check what value it stores?

javascript: "name=u_XXX_access^inactive=false^element=u_work_type^dependent_value=" + current.variables.request_source.toString() + "^EQ"

Mark āœ… Correct if this solves your issue and also mark šŸ‘ Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Thank you for the quick response Ankur bu I tried with toString() and it made no difference

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Looks pretty oke to me. Your use of current.variables is also valid.

I don't know the technical why yet, though a few weeks a go I stumbled on something similar and just removed the ^EQ part. It worked then somehow. Still have to find out why technically (also because this looks to be generated by default reference type).

So, try to remove:

+ "^EQ"

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thank you for the quick response Mark but I tried without the "^EQ" and it made no difference