sn-record-picker public
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2017 08:40 AM
Is it possible to expose a custom or out of box table (read only) in a widget to unauthenticated users?
I have my widget public, page public, and public role on table but it only works when logged in. It just shows searching when not authenticated.
Any idea?
<sn-record-picker field="location2" table="'cmn_location'" display-field="'name'" default-query="'GOTOu_hierarchy_typeLIKEBuilding^u_hierarchy_type=Building^parent=54ece5a74f5dfa4070dee3414210c738'"
value-field="'sys_id'" search-fields="'name'" page-size="100" >
Thanks,
Jack
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 07:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 09:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 11:30 AM
This is what I have working, make locations public and widget public too.
HTML template:
<div id="name-group" class="form-group" ng-class="{'has-error' : SafetyForm.location.$invalid && !SafetyForm.location.$pristine}">
<label>Location*</label>
<ui-select ng-model="c.selected.value" on-select="c.onSelectCallback($item, $model)" ng-required="true">
<ui-select-match>
<span ng-bind="$select.selected.name"></span>
</ui-select-match>
<ui-select-choices repeat="item in (c.locations | filter: $select.search) track by item.sys_id" refresh="c.refreshLocation($select.search)"
refresh-delay="0">
<span ng-bind="item.name"></span>
</ui-select-choices>
</ui-select>
<span class="help-block" ng-show="SafetyForm.location.$invalid && !SafetyForm.location.$pristine">
Please describe the location.
</span>
</div>
**************
Server :
(function() {
var locations = [];
if(input && input.action === 'searchLocation'){
var grl = new GlideRecord('cmn_location');
if(options.locations_query){
grl.addEncodedQuery(options.locations_query);
}
grl.addQuery('name', 'CONTAINS', input.query);
grl.setLimit(20);
grl.query();
while(grl.next()){
locations.push({
name: grl.name.toString(),
sys_id: grl.sys_id.toString()
});
}
data.locations = locations;
return data;
}
*****
Client
c.locations = [];
c.data.location = '';
c.selected = {value: c.locations[0]};
c.refreshLocation = function(query){
if(query) {
c.server.get({
action: 'searchLocation',
query: query
}).then(function(response){
c.locations = response.data.locations;
});
}
}
c.onSelectCallback = function(item, model) {
c.data.location = item.sys_id;
}
c.remove = function (item) {
var index = c.data.files.indexOf(item);
c.data.files.splice(index, 1);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 06:34 AM
So I also had a high ticket in for this and ServiceNow came up with almost the same answer.
Theirs was two part:
- Make the page <whatever the table is you are trying to use the record picker against> public
- Because I had multiple widgets using the sn-record-picker, put a security rule to allow the role "public" access
Honestly Jack, I appreciate you coming back and replying. You should mark your own answer correct so that others can find it easier.
Thanks Much!