expert advice needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 06:51 PM
we have a project to add a new barcode scanning widget on servicenow but the admin wants have a container to host that widget on the walkup check in page without affecting the current functionality. he is does not want to clone that existing page with an acl control on it
solution :using the widget directive in your container's HTML
is this correct way of doing ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 07:18 PM
Hi @chercm ,
Your Solution approach is in the right direction !!
If there is no specific reason to use the plain widget directive instead of spWidget you could do something like:
HTML
<div class="panel">
<div ng-repeat="elem in c.data.elements">
<sp-widget widget="elem"></sp-widget>
</div>
</div>
Server Script
var listOptions = [
{
"table":"sc_request",
"display_field":"request",
"filter":"request_state=requested^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
"order_direction": "",
"order_by": "sys_created_on",
"sp_page":"nr_sc_request",
"secondary_fields":"request_state,price",
"maximum_entries": 2
},
{
"table":"incident",
"display_field":"number",
"filter":"state=1^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
"order_direction": "desc",
"order_by": "sys_created_on",
"sp_page":"nr_sc_request",
"secondary_fields":"state,short_description",
"maximum_entries": 3
}]
data.elements = listOptions.map(function(optionList){
return $sp.getWidget('widget-simple-list', optionList);
});
Results:
And the same thing should be able to be done (small tweak) with spUtil if it's required to be done client side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 05:47 AM
i have this laptop scanning service portal widget :
how can i embed this in a container on the walkup portal page without cloning ?