- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
02-25-2023 07:11 AM - edited 02-25-2023 07:13 AM
Scoped Applications in ServiceNow are a powerful way to create secure custom applications which are completely separated from the rest of the platform. Unfortunately, this often leads to situations where certain artifacts (aka application files) have been created in the wrong scoped app (or worse: in a customized store application). Of course, you could delete such "stray" files and recreate them in the target app, but often this is not possible due to the numerous references that already exist. |
|
The better approach would be to move the affected artifacts to another scoped application - just as it is possible between global scoped applications. Unfortunately, there is no corresponding function for this OOTB and ServiceNow itself says in the KB article KB0820186 that this is not possible. Also the answers in the community are accordingly rejecting.
However, via a small detour you can achieve the goal and the corresponding solution, which is presented in this article, is so trivial that I wonder if the whole thing is possibly a security risk.
Challenge
In an FSM-based implementation you have to deal with a huge amount of configurations, and schedules play a central role here, because all calculations in the "Dynamic Scheduler" are based on them.
FSM agents each have an individual schedule in which they can enter personal appointments. These personal schedules are not created automatically with the creation of a new user, but only when the agent wants to create the first personal appointment. And depending on the scenario, it can happen on a DEV that the personal schedules are created in a scoped app instead of in "Global" when using a test user. But once created, there is no option "Move to Application ..." available in the context menu:
As a result, unwanted artifacts like these schedules are carried over to the next instance, which can cause problems.
Solution
When importing records previously exported as XML, no checks are performed and the data is imported as it is. This gives us the opportunity to manipulate the XML data before re-importing it, because the XML exports are simply text files and can therefore be edited in any text editor. And the affiliation to an application is represented in an XML export by the two XML elements <sys_package> and <sys_scope>.
For the above example record of a schedule, it will look like this:
These two XML elements now only have to be replaced with the corresponding values of the desired application. In my example, they should be moved into the "Global" scope. Therefore the two highlighted lines in my above screenshot have to be replaced with:
<sys_package display_value="Global" source="global">global</sys_package>
<sys_scope display_value="Global">global</sys_scope>
After saving and importing the modified XML file, you might get an error like this:
It took me a while finding out that in your application picker you have to choose the application your record to be moved is in currently. After selecting "Field Service Capacity and Reservations Management" the XML file could be imported without any problems and the Application columns now displays "Global"
This application file movement is not restricted to the "Global" target. I also tried successfully moving between two scoped applications!
With the same approach, you also can move all application files to another scoped application. To do this, go to the table "sys_metadata", select the desired application and then start an XML export. Then open the exported XML file in a text editor and use the "Find and Replace" function to perform the same replacement of the XML elements <sys_package> and <sys_scope> as before in the example with only one application file.
- 9,293 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Holy cow!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for sharing Maik!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice, good trick. Building store app needs lot of modification, for example you want to move artifacts across scopes or do changes to many files. As a SN employee you get the local environment to work with the artifacts in IDE.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is an amazing trick! Thank you for sharing.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
That’s gonna come so handy for people (like me) who keep on switching in between different scopes. I went as far as to edit the XML files as you did, but then hit the same issue you explained… and gave up. Thanks for cracking it!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you for sharing!
Also nice with the Saxon Switzerland NP in the banner 😉
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Congrats! You are the first to realize that! 😉

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
The KB which says doing this is NOT supported, and outlines that it can be a dangerous operation.
"is so trivial that I wonder if the whole thing is possibly a security risk." It is trivial to do many things in SN land that you should avoid but that isn't itself a security risk. In order to be powerful and flexible, some things are allowed, that you should not do, or only do in certain situations. 'I didn't notice I created the application file into the correct scope' - isn't one of those times its worth breaking the glass, and doing a dangerous operation in my experience. It won't always or maybe even frequently cause an issue, but it isn't worth the risk.
Instead focus on putting things in the right scope up front, and use the times when that is missed as a reminder to do so.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Andrew Barnes -Re: Instead focus on putting things in the right scope up front, and use the times when that is missed as a reminder to do so.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Part of the reason moving files between scopes isn't supported will likely be down to intellectual property rights of the organisation they originated from.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I created an idea for this topic:
Maybe in some years ( 🙂 the servicenow team will develop a solution for this challenge.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you for sharing! Really helpful
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Really great post and comments! Thank you! I also believe ServiceNow should support that « move to scope X » as Scoped Applications are and will always be evolving. The needs for easily reorganize and restructuring when major rescope happen or need to happen is pretty obvious to me.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This was incredibly helpful - thank you so much for the detailed write up! I can't believe ServiceNow makes this so infernally complicated by design, but am very thankful there's a process for the rest of us that work in the platform out here in the real world. This saved me a ton of time re-factoring some old work on our instance - so again, thank you so very much!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
It's not recommended:
"Once you create an app in global scope or as a scoped app, moving from one to another is not recommended. There is no tool available to automatically do this migration. You may have to basically rewrite the entire app if migration is required."
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Have anyone tried this with tables?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for the great article and for documenting this @Maik Skoddow !
I've been comparing and fixing the XMLs in Notepadd ++ since my early days with ServiceNow 😁
Just to add that you could also create copies of OOTB objects and insert these into the relevant application scope by just removing the <sys_id> value.
For such cases, on top of applying the correct Application Scope and table, it will be good to delete the values for: <sys_created_by>; <sys_created_on>; <sys_mod_count>; <sys_update_name>; <sys_updated_by>; <sys_updated_on>
As this can be an overwhelming activity, there is the MultiReplace plugin available for Notepad ++ which helps a lot for bulk update on multiple records part of the XML extract file.
<sys_class_name>sys_ui_style</sys_class_name>
<sys_created_by></sys_created_by>
<sys_created_on></sys_created_on>
<sys_id></sys_id>
<sys_mod_count></sys_mod_count>
<sys_name>sn_customerservice_case</sys_name>
<sys_package display_value="Customer Service" source="sn_customerservice">51d811fad7223100b7490ee60e61034f</sys_package>
<sys_policy/>
<sys_scope display_value="Customer Service">51d811fad7223100b7490ee60e61034f</sys_scope>
<sys_update_name></sys_update_name>
<sys_updated_by></sys_updated_by>
<sys_updated_on></sys_updated_on>