Journey from Homepage to Dashboard with creating default landing page
I have recently worked on enabling Next Experience and it's really a very cool to be on new level of ServiceNow experience. Some of features are getting their journey ended here with San-Diego or in coming upgrade Tokyo.
Problem after enabling Next Experience : I will just consolidate all faced problem worked on homepage even after converting into dashboard.
1. Homepage is no more showing to customers, 2. Converted dashboard does not have owner & 3. customer does not have a specific landing page as per their own interest after enabling new UI
Somehow i have managed to handle above all with the help of some articles and some created custom background script.
Let's start applied solution by me what i think is one of good solution, there might be different ways to do same thing but it's worth of sharing my experience with you.
1. Homepage is no more showing to customers : Yes it's true and we all aware but in latest upgrade we still can make showing homepage by making false this property (com.glideapp.home.deprecate_homepages) , but ServiceNow said you can not use any more after Tokyo upgrade. So it' good to be ready and make customer to adopt this with same homepage feeling but in dashboard .. There are two ways to convert all homepages into dashboards.
First way : This is best & more convenient & ease to use. Install the Homepage deprecation help tool and then navigate to dashboard 'Homepage Deprecation' there you will get a pop with instruction to enable flow. So cool upto here but no figure/records would display on dashboard until you wont run flow or wait to run . It fetches just 1k record at a time . So here better to run flow through background script with putting some condition or you can also run multiple times flow manually to go on flow designer until there is no increment of Homepages count of dashboard.
Script to run flow through background script/scheduled job whatever you think is good for you : sn_fd.FlowAPI.getRunner().flow('sn_home_page_depr.populate_homepage_migration_status_table').inBackground().run();
Once you complete this steps , you can see total homepage count on widget (Report- Homepages Not Deprecated).
Next part is quite interesting and it takes time to convert into dashboard. Be careful while doing on prod as it's trigger event so there is possibility to have lots of ready event in queue. so converting homepages you can do in two ways either clock on figure of Homepages Not Deprecated report, it will take you to list view. There you can select rows and click on list action 'convert' , but imagine if you have more than 10k records, so better to use below script till your count comes zero in print -
var gr = new GlideRecord('pa_homepage_migration_status'); gr.addNullQuery('decision');gr.setLimit(4000);gr.query();
gs.print(gr.getRowCount());gr.setValue('decision', 'converted');gr.updateMultiple();
Once you complete this you have now converted all homepages into dashboards.
Another Way : Without installing tool 'Homepage deprecation help tool' but i will suggest first way is more easy to use and will suggest to go i am explaing just to be aware of available option on platform. Here you will have to get all sysid from table (sys_portal_page) and then pass into " var dashboardSysIds = new SNC.PortalPagesMigration().convertHomePagesAndgetAssociatedDashboards(SysIds[i]);" . But sys_portal_page contains both homepages & dashboard , very frankly i don't know how to separate only homepage on this table but script will give you null if record is dashboard or you will get sysid of converted homepage . Here you will become culprit to get owner of every dashboard by default so you will have to make sure changing owner of getting sysid .
We have completed important part & we have all converted dashboards and you can see this to navigate on dashboard 'Homepage deprecation' . I will follow first way and will explain next two.
2. Converted dashboard does not have owner : Click on figure of Converted Homepages on dashboard. All converted dashboards wont have owner because one homepage shared with multiple users will have empty owner. If you open any dashboard there owner field would be empty , we can update all together using below script , you can change setLimit or can run multiple times this script with checking list view on table (pa_homepage_migration_status) with filter (owner!=NULLdashboard.owner.nameISEMPTY)
var gr = new GlideRecord('pa_homepage_migration_status');
gr.addEncodedQuery('decision=convertedstate=3owner!=NULLdashboard.owner.nameISEMPTY');
gr.setLimit(3000);gr.query();gs.print(gr.getRowCount());
while(gr.next()){var grd = new GlideRecord('pa_dashboards');grd.get(gr.dashboard);grd.query();
if(grd.next()){grd.owner=gr.owner;grd.setWorkflow(false);grd.update();}}
3. customer does not have a specific landing page as per their own interest : We have option to show specific converted dashboard on landing page to customer, so they have same felling like homepage when they login There are some scenario here
Scen1 : Default after enabling next experience, customer will have last used dashboard in previous login
Scen2 : All customers have one landing page : Update value of system property (glide.login.home).
Scen3: Show converted dashboard to those who had set homepage on landing page : Use below script it will create a user preferences for all who had homepage on landing page otherwise will show last used dashboard to other users.var gr = new GlideRecord('sys_user_preference');gr.addEncodedQuery('name=homepagedescription!=deprecated homepageORdescription=NULL');
gr.setLimit(3000);gr.query();gs.print(gr.getRowCount());while(gr.next()){
https://www.servicenow.com/community/next-experience-articles/journey-from-homepage-to-dashboard-with-creating-default-landing/ta-p/2331941