How can I make sys_user available to a custom application?

norbert2
Giga Contributor

Hi.

I am developing an application. Within the application I have a variable (type 'Lookup Select Box') accessing the table sys_user. It all works well in Global, but not in my custom application. The User Table is not visible. Extending the user table to make it visible in my application doesn't work either. Again sys_user is not visible. What am I missing here? How can I make the User Table available to my application? You advice would be very much appreciated. Thank you in advance.

1 ACCEPTED SOLUTION

You are very welcome. Please mark my response as correct so that others with the same question can find it quickly in the future and that it gets removed from the Unanswered list. Thank you



P.S. Some users do not see the Correct Answer link (per this video at 20:00 https://community.servicenow.com/thread/224893). Let me know if you do not see it and I can get a community moderation to assist.


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Norbert,



By default, any application (scoped or global) can read from sys_user. You can test this by adding a simple reference field to your custom table that references it. I do this all the time.



If you are having issues, check the application access on sys_user with Configure> Table.



find_real_file.png


Hi, thank you for responding.


I checked the access to sys_user, and it's set exactly like in your screenshot.


However, when I create an application and try to extend the User table in the process, the User table is not in the list. Please see screenshot below.


Is there some kind of switch I need to flip to make it available perhaps?


Thank you.


Norbert


UserTableNotFound.jpg


Hi Norbert,



Ah, accessing a table and extending - two different things. Now I can see where you are coming from. To make the User (sys_user) table extensible, you need to go to that table definition (System Definition> Tables) and check the "Extensible" box, save the record.



find_real_file.png



Now it will show up in your list.


>>> Now it will show up in your list.


It does indeed. I now can create an extended table or reference fields, to access the User Table in my application. However, I cannot see they content of the User table from my application, it looks as if the User table is empty. Of course it is not, because I can see everything alright using the global scope. Which brings me back to my original problem: How can I make the User table visible for the application I am writing :



noUserTable2.jpg


Of course, as a work around, I could extract the User Table columns I need into an application table using an OnLoad script every time the service is called, but that would introduce an unnecessary delay when loading the form. Accessing the User table directly is more elegant. I am sure I am missing something here. Please help.


Thank you.


Norbert