web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Is it Possible to fetch the Sitemap Title name via javascript in D365?

(5) ShareShare
ReportReport
Posted on by 109
I am trying to fetch Sitemap name through javascript.
Is there any way to fetch the title of the Sitemap entity?
 
Categories:
I have the same question (0)
  • Suggested answer
    Jimmy Passeti Profile Picture
    595 Most Valuable Professional on at
    Is it Possible to fetch the Sitemap Title name via javascript in D365?
    Hello,
     

    Yes, it is possible to fetch the Sitemap Title Name in Dynamics 365 using JavaScript, but not directly through a supported API. The Sitemap Title Name is not exposed through the official Client API, but you can retrieve it using DOM manipulation. However, DOM-based approaches are not supported by Microsoft and may break with future updates.

    Solution (Unsupported Approach)

    You can use JavaScript to query the Sitemap Title from the navigation menu using document.querySelector. Here's an example:

    var sitemapTitle = document.querySelector(".areaTitle").innerText;
    console.log(sitemapTitle);

    Steps to Implement:

    1. Open the Developer Console (F12) in your browser.
    2. Run the script above in the Console.
    3. It should return the name of the active sitemap area.

     

    Alternative Supported Approach

    If you want to retrieve the current sitemap area in a supported way, you can use the Xrm.Utility.getGlobalContext().getCurrentAppProperties() method:

    Xrm.Utility.getGlobalContext().getCurrentAppProperties().then(function(app) {
    console.log("App Name: " + app.appName);
    console.log("App Unique Name: " + app.uniqueName);
    });

    🔹 This gives you the App Name but not the specific sitemap area.
    🔹 For precise sitemap details, you may need to retrieve navigation metadata via a custom web resource or plugin.

    getCurrentAppProperties (Client API reference)

    Recommendation

    • Use the supported API approach whenever possible.
    • If you must use the DOM method, be aware that it can break in future updates.
     
    Regards,
    Jimmy Passeti | Microsoft MVP
    ✅ Please mark as Verified if this answered your question!
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 367

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 137 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 82 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans