- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 02:48 PM
Has anyone successfully cloned the walk-up experience widget: Online check-in experience?
We want to add an option for people to reference an existing task record as part of their appointment scheduling so I need to edit the widget to give them that option.
- I've clone the widget Online Check-in Experience.
- I've created copies of the 8 ng-templates and renamed them.
- I've created copies of the 4 angular providers (directives) so they can reference the updated templates (templateUrl).
- I've looked for any "ng-include=" that needs to be updated in the HTML and updated all the inline directives.
- I've scoured the client and server scripts for any references to the original templates or directives.
And for the life of me, I still cannot get the dang widget to render properly. The "reason for visit" select box template will not render at all on the page and the Scheduling widget does not render correctly (or at all) either. The hours, location, and *parts* of the away messages do work fine.
Before I went as far as creating copies of the directives, if I had BOTH the custom widget and OOB widget on the page it *seemed* to work fine except some console errors about duplicate ID's, which is no good.
Has anyone actually been able to clone this widget and get it to work? What am I missing that the reason select box won't render and the scheduling widget call won't work? I did *not* try and clone the scheduling widget and it is using OOB.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- 5,624 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 12:10 PM
I opened a HI ticket about cloning the widget and what could have been missed. That resulted in our dev instance being rebooted. After that everything seemed to start working. I was able to confirm these steps do work in an entirely different instance.
Clone the Widget
- Make sure you are in the "Walk-Up Experience" application scope!
- Go to Service Portal > Widgets and open the widget Online check-in experience (online-check-in-experience).
- At the top-right, click Clone Widget.
- If you weren't redirected to your widget, open the copy you just created.
- Give your copy a new ID (top left). For the remainder of this post, I'll use the suffix copy for everything, but you can name it whatever you want.
- "online-check-in-experience-copy"
Copy the 8 ng-templates
- Open the OOB widget.
- Scroll down to the Templates related list.
- Make a copy of all 8 templates and attach it to your copied widget. The name must be unique. I used the suffix of Copy (with a capital C) for each template.
- It must be in camel case and no special characters! Not even dashes!
- It will be referenced in kebab case in the HTML (you'll see later).
- For reference here are the ng-templates I made copies of. You do not need to change anything in these templates.
- awayMessagesCopy
- onlineConfirmationModalCopy
- promptConfirmationModalCopy
- queueTemplateCopy
- reasonForVisitSelectCopy
- scheduledHoursCopy
- walkUpAppointmentPanelCopy
- This is the one that tricked me. If you notice on line 9 in the walkUpAppointmentPanel template, there is this ng-transclude. This does not need to be changed. You'll see where it gets referenced by a directive later.
<!-- Child element of directive -->
<div ng-transclude="reasonSelect" ng-if="!c.hasAppointment"></div>
- walkUpOnbehalfAppointmentPanelCopy
- Just like its counterpart above, there is also an ng-transclude looking at reasonSelect.
Copying and updating the 4 Agular Providers (just the Directives)
- Open the OOB widget and scroll down to the Angular Providers related list.
- You will need to make copies of these 4 directives, with new names, and include these changes:
- onlineScheduleMessageCopy
- Update line 10 with the copied template name: templateUrl: 'awayMessagesCopy',
- reasonForVisitSelectCopy
- Update line 12 with the copied template name: templateUrl: 'reasonForVisitSelectCopy',
- walkUpAppointmentCopy
- Update line 15 with the copied template name: templateUrl: 'walkUpAppointmentPanelCopy',
- Update line 18 in the transclude with the copied reasonForVisitSelectCopy template: templateUrl: 'walkUpAppointmentPanelCopy',
- This is where that transclude from the ng-template happens.
- walkUpOnbehalfAppointmentCopy
- Update line 16 with the copied template name: templateUrl: 'walkUpOnbehalfAppointmentPanelCopy',
- Update line 19 in the transclude with the copied reasonForVisitSelectCopy template: 'reasonSelect': '?reasonForVisitSelectCopy'
- Open your cloned widget.
- Scroll down to the Angular Providers related list.
- Remove the 4 original directives.
- onlineScheduleMessage
- reasonForVisitSelect
- walkUpAppointment
- walkUpOnbehalfAppointment
- Add your 4 copied and updated directives.
- onlineScheduleMessageCopy
- reasonForVisitSelectCopy
- walkUpAppointmentCopy
- walkUpOnbehalfAppointmentCopy
Updating the widget's HTML
- Open your cloned widget.
- You can open it in the full UI or in the widget editor, it does not matter.
- Calls to the angular directives and templates will be made using kebab case in HTML. Google it if you don't know what it is.
- Unfortunately, there are no line numbers in the HTML field. To make this significantly easier to point out where to make changes, copy the entire HTML contents into the HTML field of a UI page so you can see line numbers.
- Copy all the HTML contents from your widget.
- Create a new UI Page (you do not need to save it).
- Delete all the contents in the HTML field on the UI page.
- Paste the HTML from your widget into the HTML field on the UI page.
- Now things can be referenced by line number (or you can search the HTML for the changes noted below).
- At line 108
- Change <online-schedule-message to <online-schedule-message-copy
- At line 112
- Change </online-schedule-message> to </online-schedule-message-copy>
- At line 116
- Change <reason-for-visit-select to <reason-for-visit-select-copy
- At line 120
- Change </reason-for-visit-select> to </reason-for-visit-select-copy>
- At line 135
- Change <online-schedule-message to <online-schedule-message-copy
- At line 139
- Change </online-schedule-message> to </online-schedule-message-copy>
- At line 161
- Change <div ng-include="'queueTemplate'"></div> to <div ng-include="'queueTemplateCopy'"></div>
- This one does not go to kebab case because it is being called as an include.
- At line 177
- Change <walk-up-appointment to <walk-up-appointment-copy
- At line 187
- Change <reason-for-visit-select to <reason-for-visit-select-copy
- At line 192
- Change </reason-for-visit-select> to </reason-for-visit-select-copy>
- At line 193
- Change </walk-up-appointment> to </walk-up-appointment-copy>
- At line 215
- Change <walk-up-onbehalf-appointment to <walk-up-onbehalf-appointment-copy
- At line 226
- Change <reason-for-visit-select to <reason-for-visit-select-copy
- At line 231
- Change </reason-for-visit-select> to </reason-for-visit-select-copy>
- At line 232
- Change </walk-up-onbehalf-appointment> to </walk-up-onbehalf-appointment-copy>
- At line 245
- Change ng-include="'scheduledHours'" to ng-include="'scheduledHoursCopy'"
- Copy the updated HTML back into your cloned widget.
- Change <div ng-include="'queueTemplate'"></div> to <div ng-include="'queueTemplateCopy'"></div>
Updating the widget's client controller
- Open your cloned widget.
- You can open it in the full UI or in the widget editor, it does not matter.
- On line 312
- Change c.data.msgs.agreeModalMsg, c.data.msgs.stayInQueueMsg, clearFields, postLeaveQueueConf, 'promptConfirmationModal');
- To c.data.msgs.agreeModalMsg, c.data.msgs.stayInQueueMsg, clearFields, postLeaveQueueConf, 'promptConfirmationModalCopy');
- On line 591
- Change walkUpModal.thresholdModal($scope, data.userPosition, 'onlineConfirmationModal');
- To walkUpModal.thresholdModal($scope, data.userPosition, 'onlineConfirmationModalCopy');
- On line 640
- Change clearFields, postQueueChange, 'promptConfirmationModal');
- To clearFields, postQueueChange, 'promptConfirmationModalCopy');
Put your copied widget on a page and give it a test.
This worked for me on a fresh instance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2021 12:00 PM
Hi;
I was wondering after cloning the widget and using the cloned widget instead of the OOB widget, did anybody have issues with the OOB walkup notifications and walkup events(to trigger the notifications)?
I followed the steps mentioned above to clone the "online check-in experience" widget. I then used the cloned widget on the walkup page instead of the OOB widget. After that, I noticed the OOB walkup notifications are not being sent out any more. That is due to all the OOB walkup events are not being generated to trigger the notifications.
Appreciated your help.
Thanks,
Renee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2021 10:22 AM
I suspect this is simply not something that was thought of by the original author and they're not worried about the notifications so it wasn't included in this guide...which is a shame because I am also interested in the notifications and if you've followed this guide and come up with issues, I suspect I may also. I am not anticipating this discovery as I doubt it will be easy to resolve...I have no ng-angular experience and we have no resource for that in our company and this seems to be a specific thing for some widgets (ones with ng-angular templates are not "straight forward" or "wysisyg" -- https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745615)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2021 03:40 PM
Hello.
They should check if the corresponding steps were followed, in my case after cloning everything works correctly and we have customized the sending of notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2021 08:40 AM
Mario, I'm interested to know what version of SN you are on. We tried what others have mentioned above and we also had issues with the notifications. Can you explain in more detail what you mean by "we have customized the sending of notifications"? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2021 08:40 AM
Renee,
We also have had problems with the notifications not triggering.