How to safely allow users control over choices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 02:14 PM
We have an app where we get frequent requests for updates to sys_choice rows. I'd like to give the users a way to do these updates themselves, without a major refactor, without a mass data update, and without having them touch sys_choice or know anything about it. So I thought to set up a table to act as a front end for sys_choice, and use business rules to push whatever updates are made to that proxy table into sys_choice, making sure that I'm operating only on rows belonging to this table in this app. (There will be other business rules, not shown here, to ensure this.)
My table is called x_99999_kwtest1_communication. This is the table the choices belong to. Here's what I've tried:
- I created a table 'x_99999_kwtest1_storecommkwproxy', modeled after sys_choice. This is the proxy table the user do inserts on.
- Updated sys_choice and sys_choice_set to allow inserts and updates from other applications.
- Created a business rule to run after Insert:
(function executeRule(current, previous /*null when async*/) {
var sc = new GlideRecord("sys_choice");
sc.initialize();
sc.setValue("name", "x_99999_kwtest1_communication"); /* hard coded */
sc.setValue("element", current.getValue("element"));
sc.setValue("hint", current.getValue("hint"));
sc.setValue("label", current.getValue("label"));
sc.setValue("value", current.getValue("value"));
sc.setValue("dependent_value", current.getValue("dependent_value"));
sc.setValue("inactive", current.getValue("inactive"));
sc.setValue("language", current.getValue("language"));
sc.insert();
})(current, previous);
The idea here is that users who have permission to do inserts etc on my proxy table can thereby do inserts on sys_choice.
But when I run this I get:
Invalid 'Table' selected on the Choice record. The 'Communication' table is in application 'KWTest1', but the current application is 'Global'. The 'Table' field can only select 'KWTest1' tables with read and alter access enabled.
It sounds like this business rule will only do inserts etc on tables in the same scoped application the user is in. Is there any way to get this technique to work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 02:16 PM
Hi Thomas,
You have to make the x_99999_kwtest1_communication available to be edited by the global application as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 02:44 PM
Varun,
I tried allowing all application scopes to write to both my communication and proxy tables, but this made no difference. Can you think of anything else?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 02:18 PM
Hello Thomas,
You are right. OOTB table application access setting only allow to read the sys_choice records from other scope and don't allow create, write and delete operation.
http://wiki.servicenow.com/index.php?title=Application_Access_Settings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 02:49 PM