How can I fetch catalog item's sys_id or name in User Criteria script?

Akshat Joshi
Kilo Contributor

Hey Folks!

I want to apply a scripted User Criteria to some of the catalog items. To determine the visibility, I need the name of the catalog item(or sys_id) of the catalog item.

I have already tried using RP.getParameterValue("sysparm_id") mentioned in this link https://community.servicenow.com/community?id=community_question&sys_id=1546cba1db1cdbc01dcaf3231f9619fe. However, it gives an error saying RP is not defined. Could you please suggest an alternative to this?

Thanks,

Akshat

13 REPLIES 13

Hi Ankur,

I already have this workaround in place. However, there are many catalog items visible to users which they cannot access. Users open them and are made to realize that they cannot order them. 

It keeps the rule for accessibility intact but reduces the user experience to a great extent.

 

Many thanks for your time though 🙂

 

Best Regards,

Akshat

 

Hi Akshat,

please remember to tag the comment as correct answer and also as helpful.

This helps others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Regards
Ankur

 

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

Hi Akshat,

please remember to tag reply as correct answer and also as helpful.

This helps others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Regards
Ankur

 

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

manu61
Mega Contributor

@Akshat Joshi - Hi Akshat, Did you make it working without using onLoad client script? Any other workaround as we have the similar requirement as you.