UI Builder Form Component Validation Messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 03:05 PM
How can I get the validation messages (e.g., required field not filled in) to show? Also, can I access an event to allow me to show a Save succeeded or Save failed message? I don't see what event to use on the form component or the glide form data resource. (A pointer to a really good video or tutorial on the form component details would be most welcome.)
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 03:14 PM
Hi Velma,
Check these links if thats what you looking for
UI Builder Form Validation - Youtube
Mark Correct or Helpful if it helps.
Thanks,
Yousaf
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 05:54 AM
Thanks, @Yousaf. That video is about validation and hand-jammed forms. (I do remember watching it some time ago, and I have built some hand-jammed forms.) This question though is about using the form component and glide form--that is standard ServiceNow forms--which is entirely separate from that. (Client scripts could be relevant if there are events I could capture to generate the messages myself--but I am unable to find those events.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 07:47 AM
Hi,
Is this your custom page?
There are many ways to show your message.
1. From event.
On event trigger you can use "Add Alert Notifications" event. It is a page level event handler.
It accepts data in JSON format. Example below:
[{"type":"info","message":"Successfully saved the record."}]
2. From page script.
If you are triggering the event and want to show the notification after validating or executing some other logic then you can show your alert from page script as well. Example below.
api.emit("NOW_UXF_PAGE#ADD_NOTIFICATIONS", {
items: [{
id: "alert1",
status: "critical",
icon: "info-circle-outline",
content: {
type: "string",
value: "Failed to update."
},
action: {
type: "dismiss"
},
}]
});
here api.emit is used to emit any page level notification. "NOW_UXF_PAGE#ADD_NOTIFICATIONS" is the event name which is used in point 1. Only thing you need to change here is Status, icon if needed and the content.
Mark correct/helpful if it works for you. 🙂
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2022 08:49 AM
Thank you,