- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello everyone,
I have created a new formatter and this is the UI macro for this Formatter.
function onChange(control, oldValue, newValue) {
setTimeout(function() {
var wrapper = document.getElementById('refreshWrapper');
if (!wrapper) return;
wrapper.style.display = newValue ? 'flex' : 'none';
}, 300);
}
However this does not seem to be working. Do you any recommendations or ideas about what might be wrong ? Any help would be appreciated.
Best Regards,
Beyza
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
the only way is DOM manipulation which is not recommended practice
Ensure for your client script Isolate Script = False
This field is not on form but from list you can make it false
are you using the correct HTML element ID for that -> refreshWrapper
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Ankur,
Thank you for the suggestion.
I understand that updating the UI Action condition. It worked but only after the form is saved. I need the UI Action to become visible immediately when the user changes the Type field, even before saving the form.
Best regards,
Beyza