How to display message on form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 07:24 AM
Hello Team
I would like to show message on top of the form, before submitting.
My form is like this.
I am new to ServiceNow please help me in this requirement.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 12:05 AM
Hi,
Please follow the below screenshots:-
Here in above screenshot i have created a display Business rule and Whatever message i have written in script of display BR. that is displayed on incident for as i applied it on incident table before submitting the record.
If i was able to solve your query, please mark my answer correct and helpful.
Thanks & Regards
Prasant kumar sahu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2020 08:13 AM
This helped me, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 01:46 AM
To show a message on top of the form before submitting in ServiceNow, you can use the g_form.addInfoMessage() method in client script. Here are the steps:
1. Navigate to "System Definition > Client Scripts".
2. Click on "New" to create a new client script.
3. Fill in the necessary fields:
- Name: Give a name to your client script.
- Table: Select the table for which you want to show the message.
- Type: Select "OnLoad" to show the message when the form loads.
4. In the "Script" field, add the following code:
g_form.addInfoMessage('Your message here');
Replace 'Your message here' with the message you want to display.
5. Click on "Submit" to save the client script.
This will display an informational message on top of the form when it loads. If you want to show the message only when certain conditions are met, you can add a condition in the script. For example:
if (g_user.hasRole('admin')) {
g_form.addInfoMessage('You are an admin');
}
This will show the message "You are an admin" only to users with the 'admin' role.
nowKB.com
If you want to know any information about Service Now . Visit to https://nowkb.com/home