Hide a button from UI Page dynamic - based on role - HOW?

Martin Ivanov
Giga Sage
Giga Sage

Hello,

I have a requirement to hide the Cancel button from the assessment UI page (assessment_take2).

This must be based on a role - e.g. 'xxx_admin'. If the user has it - show the button. Else - hide it.

I can find a variable which is determining wether the button must be hidden or not, but Jelly is one of my strenghts. Could you, please guide me how to set this variable based on the user, taking the assessment.

find_real_file.png

This will be highly appreciated!

Thanks!

Martin


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

1 ACCEPTED SOLUTION

I fugured it out, thanks!


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

View solution in original post

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Hello,

Where ever this page is getting called, you have the parameter sysparm_hide_cancel that you can set to true to hide it. Please set it there using that parameter.

If you still need assistance, please give more information as to where this is being called (UI Action or otherwise) and speak to your peers at Deloitte for quicker and more interactive assistance.

https://developer.servicenow.com/dev.do#!/reference/api/rome/client/c_GlideModalClientSideV3API#r_GM...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

the UI page is called by a UI action (Take assessment), where the url is built. I tried to pass the 'sysparm_hide_cancel' to the url but it gets disregarded. Any Idea on how to proceed?

 

find_real_file.png

find_real_file.png


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

I fugured it out, thanks!


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

Hello @Martin Ivanov 

I see you've marked your own reply as Correct?

Did my reply above not guide you Correctly?

-Allen


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!