- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 05:40 AM
Hello Team,
I have on variable in catalog which is choice type , Access and Revoke two option . if i choose Access then field A, Field B and Filed C need to show for the user or else if user selects Revoke then Filed A and Field B needs to be show for that .
Could you please explain me how we can achieve this .
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 06:32 AM - edited 09-13-2023 09:58 PM
Hello @Community Alums ,
You have to create 2 UI policies for this :
1 ) In first UI policy : mention the condition for choice Access -> in UI policy action choose A,B and C and make Visible = True
Note : Keep different order value of UI policy and also UI policy action
2 ) In second UI policy : mention the condition for choice Revoke -> in UI policy action choose A and B and make Visible = True
Note : Keep different order value of UI policy and also UI policy action
Please mark my solution as Helpful/Correct, if applicable.
Thanks and Regards,
Sayali Gurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 05:44 AM
@Community Alums
you can create onChange catalog client script on that choice variable
script will look something like this. please enhance it from your side
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
// give here correct choice values
if (newValue == "access") {
g_form.setDisplay('variableA', true);
g_form.setDisplay('variableB', true);
g_form.setDisplay('variablec', true);
} else if(newValue == 'revoke'){
g_form.setDisplay('variablec', false);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 06:32 AM - edited 09-13-2023 09:58 PM
Hello @Community Alums ,
You have to create 2 UI policies for this :
1 ) In first UI policy : mention the condition for choice Access -> in UI policy action choose A,B and C and make Visible = True
Note : Keep different order value of UI policy and also UI policy action
2 ) In second UI policy : mention the condition for choice Revoke -> in UI policy action choose A and B and make Visible = True
Note : Keep different order value of UI policy and also UI policy action
Please mark my solution as Helpful/Correct, if applicable.
Thanks and Regards,
Sayali Gurav