Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How do I add the Notification field from sys_user to a form

jacrump87
Tera Contributor

I am trying to show if a person has their Notifications enabled or disabled to a form.  I have tried referencing sys_notification and sys_user but cannot get it to populate the field with enable or disable.

1 ACCEPTED SOLUTION

jcmings
ServiceNow Employee

You need to dot-walk into the User via Form Layout. I was able to do this for the Caller field on the Incident form by going to Configure > Form Layout and then expanding the Caller reference field.

jc21_1-1736277282146.png

 

And now I can see it on the Incident form after saving:

jc21_0-1736277252258.png

 

 

Side note: if you are trying to display if notifications have sent in the activity stream, you can follow KB0719147. Just make sure you have the emails marked as sent in the sys_email table (as mentioned in the KB).

View solution in original post

5 REPLIES 5

jacrump87
Tera Contributor

I have an existing form that displays various fields, including Respondents.  The current issue we have is that Analysts don't know if a Respondent has turned their notifications off so I wanted to add a "Notification Enabled" field under the Respondent field, and reference the sys_user table, Notification column to show if it's enabled or disabled.

jcmings
ServiceNow Employee

You need to dot-walk into the User via Form Layout. I was able to do this for the Caller field on the Incident form by going to Configure > Form Layout and then expanding the Caller reference field.

jc21_1-1736277282146.png

 

And now I can see it on the Incident form after saving:

jc21_0-1736277252258.png

 

 

Side note: if you are trying to display if notifications have sent in the activity stream, you can follow KB0719147. Just make sure you have the emails marked as sent in the sys_email table (as mentioned in the KB).

jacrump87
Tera Contributor

Apologies, I should have included more information.  We have an existing form with a Respondent field.  The issue is that some users (Respondents) disabled their notifications and the Analysts would like a quick way to identify if they have them disabled rather than going to the user table to look for each one.  So I figured I'd add a new "Notifications Enabled" field and reference the sys_user table, and notifications table.  When I create the field, reference the User table, I can't seem to get the field to populate.  I've tried using sys_notification as well for reference and it doesn't seem to be working.

jcmings
ServiceNow Employee

Just a note, you'll probably want to ensure the field is read-only and may even want to add an onLoad client script to change its label. I'm also not 100% sure that the user preference is stored on the sys_user table. It may be in sys_preferences.