<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Finding where cmn_location records are used, and retiring old/unused/incorrect records in CMDB forum</title>
    <link>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3201040#M14802</link>
    <description>&lt;P&gt;Check whether the script attached in the following URL is helpful:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/common-service-data-model/migrating-into-csdm-identifying-table-dependencies/ta-p/2308617" target="_blank"&gt;https://www.servicenow.com/community/common-service-data-model/migrating-into-csdm-identifying-table-dependencies/ta-p/2308617&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 09:03:44 GMT</pubDate>
    <dc:creator>Ashok Sasidhara</dc:creator>
    <dc:date>2025-03-10T09:03:44Z</dc:date>
    <item>
      <title>Finding where cmn_location records are used, and retiring old/unused/incorrect records</title>
      <link>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3200550#M14798</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in the process of sorting out a severely under-maintained CMDB. We're starting CSDM adoption at the foundation layer and Locations (cmn_location) is my first target.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a taxonomy and high-level list of locations sorted on paper, following common sense standards of Region&amp;gt;Country&amp;gt;City&amp;gt;Site&amp;gt;Building&amp;gt;Room. The challenge I am now facing is that we have 457 locations - almost all of which are just plain wrong. We've got supplier names in there, misspelt site names, some individual desks, you name it. As I progress through my CMDB fix, I expect this will be a regular theme and I expect we're going to be archiving nearly 95% of our CMDB then repopulating with ITOM Discovery.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming these records have been added at one time or another, and other elements on the platform may rely on them. My next question: is there a way to identify if a specific record is being used on the platform somewhere? The risk I need to mitigate is me archiving a location, then finding that some key part of reporting or flow relies on that record. If this solution can be applied to other records, such as those in the CMDB, that would be of great help.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Mar 2025 15:44:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3200550#M14798</guid>
      <dc:creator>RichardH6439164</dc:creator>
      <dc:date>2025-03-09T15:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Finding where cmn_location records are used, and retiring old/unused/incorrect records</title>
      <link>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3200557#M14799</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/660942"&gt;@RichardH6439164&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is exact same issue that we at our end are facing now and tbh there are several key flows and approvals where location is being referenced. So this is the approach I used, however I am still not completely confident to go ahead and archive it - risking the break of well running flow - the having a whole lot of additional task to fix it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var locationSysId = 'YOUR_LOCATION_SYS_ID_HERE';&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord('sys_metadata');&lt;/P&gt;&lt;P&gt;gr.addQuery('name', 'cmn_location');&lt;/P&gt;&lt;P&gt;gr.query();&lt;/P&gt;&lt;P&gt;while (gr.next()) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; var tableName = gr.name.toString();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; var refQuery = new GlideRecord(tableName);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; refQuery.addQuery('location', locationSysId);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; refQuery.query();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (refQuery.hasNext()) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info("Location is referenced in table: " + tableName&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may refer above code, hope that helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Kindly mark my answer as helpful and accept solution if it helped you in anyway,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shivalika&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My LinkedIn - &lt;A href="https://www.linkedin.com/in/shivalika-gupta-540346194" target="_blank"&gt;https://www.linkedin.com/in/shivalika-gupta-540346194&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My youtube - &lt;A href="https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&amp;amp;si=0WynLcOwN" target="_blank"&gt;https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&amp;amp;si=0WynLcOwN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;eEISQCY&lt;/P&gt;</description>
      <pubDate>Sun, 09 Mar 2025 16:07:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3200557#M14799</guid>
      <dc:creator>Shivalika</dc:creator>
      <dc:date>2025-03-09T16:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Finding where cmn_location records are used, and retiring old/unused/incorrect records</title>
      <link>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3201040#M14802</link>
      <description>&lt;P&gt;Check whether the script attached in the following URL is helpful:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/common-service-data-model/migrating-into-csdm-identifying-table-dependencies/ta-p/2308617" target="_blank"&gt;https://www.servicenow.com/community/common-service-data-model/migrating-into-csdm-identifying-table-dependencies/ta-p/2308617&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 09:03:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/cmdb-forum/finding-where-cmn-location-records-are-used-and-retiring-old/m-p/3201040#M14802</guid>
      <dc:creator>Ashok Sasidhara</dc:creator>
      <dc:date>2025-03-10T09:03:44Z</dc:date>
    </item>
  </channel>
</rss>

