Hide a section in the form .
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
There is a section to be hidden on the form .The form should only be visible if the Channel is self service .I tried client script but it is not working .I also tried UI policy .Below is the code I tried ,Please let me know if I am missing anything.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === 'self-service') {
//if (newValue == 'self-service') {
var sectionName = 'Portal Form';
//g_form.getSections()
g_form.setSectionDisplay(sectionName, true);
} else {
g_form.setSectionDisplay(sectionName, false);
}
return;
}
//Type appropriate comment here, and begin script below
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @Devika
You can refer this demo for hiding form Sections:
https://youtu.be/YHWYSpICFFk?si=BDfyXvZd8c4fFj-K
********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
For More Information, please check details below: In this session, I have explained how we can Show or Hide Form sections under some conditions using UI Policy ========================UI POLICIES========================== TABLE - Problem CONDITIONS - Priority is P2 Execute if true Scripts - ...