- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:28 PM
hello
I'm now plagued by the default values for the fields.
For field A, set the string "test" to the default value.
When creating a new record, "test" is entered in field A with a default value.
If field A is set to blank when creating and saving a new record, is it unavoidable to enter the default value "test" instead of blank?
I thought the value displayed on the screen by default when creating a new record was the "default value".
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:35 PM
Hi,
Sorry what's your challenge?
the default value will be shown when form loads; if user doesn't enter anything the field would have that value shown
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:35 PM
Hi,
Sorry what's your challenge?
the default value will be shown when form loads; if user doesn't enter anything the field would have that value shown
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:41 PM
Hey,
To add to what Ankur mentioned above, if you are creating manually using New button in list layout.
If you want to skip having default value on the form, use initialize() in scripts:
initialize() - Creates an empty record suitable for population before an insert.
newRecord() - Creates a GlideRecord, set the default values for the fields and assign a unique id to the record
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar