Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔

If you’re struggling to retrieve the sitemap used by a given Model Driven App, maybe it’s because relationship between the two is not 1-N (as one may expect, given the fact that each MDA has one and only one sitemap), but it’s mediated by the appmodule…


This content originally appeared on DEV Community and was authored by Riccardo Gregori

If you're struggling to retrieve the sitemap used by a given Model Driven App, maybe it's because relationship between the two is not 1-N (as one may expect, given the fact that each MDA has one and only one sitemap), but it's mediated by the appmodulecomponent table, as per the schema below:

E-R Relationship between appmodule and sitemap

Given this statement, if you need to retrieve the sitemap you can use the following query:

SELECT TOP 1
    am.appmoduleid,
    am.name,
    am.uniquename,
    sm.sitemapid,
    sm.sitemapname,
    sm.sitemapxml
FROM 
    appmodule am
    INNER JOIN appmodulecomponent amc ON am.appmoduleidunique = amc.appmoduleidunique
    INNER JOIN sitemap sm ON amc.objectid = sm.sitemapid
WHERE 
    amc.componenttype = 62  -- 62: sitemap
    and am.uniquename = 'YOUR APP UNIQUE NAME'

or, if you prefer FetchXML syntax:

<fetch top="1">
  <entity name="appmodule">
    <attribute name="appmoduleid" />
    <attribute name="name" />
    <attribute name="uniquename" />
    <link-entity name="appmodulecomponent" to="appmoduleidunique" from="appmoduleidunique" alias="amc" link-type="inner">
      <link-entity name="sitemap" to="objectid" from="sitemapid" alias="sm" link-type="inner">
        <attribute name="sitemapid" />
        <attribute name="sitemapname" />
        <attribute name="sitemapxml" />
      </link-entity>
      <filter>
        <condition attribute="componenttype" operator="eq" value="62" />
      </filter>
    </link-entity>
    <filter>
      <condition attribute="uniquename" operator="eq" value="YOUR APP UNIQUE NAME" />
    </filter>
  </entity>
</fetch>

Hope this helps!


This content originally appeared on DEV Community and was authored by Riccardo Gregori


Print Share Comment Cite Upload Translate Updates
APA

Riccardo Gregori | Sciencx (2025-09-07T12:21:08+00:00) Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔. Retrieved from https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/

MLA
" » Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔." Riccardo Gregori | Sciencx - Sunday September 7, 2025, https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/
HARVARD
Riccardo Gregori | Sciencx Sunday September 7, 2025 » Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔., viewed ,<https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/>
VANCOUVER
Riccardo Gregori | Sciencx - » Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/
CHICAGO
" » Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔." Riccardo Gregori | Sciencx - Accessed . https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/
IEEE
" » Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔." Riccardo Gregori | Sciencx [Online]. Available: https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/. [Accessed: ]
rf:citation
» Dataverse internals: how to get the Sitemap of a given Model Driven App 🤔 | Riccardo Gregori | Sciencx | https://www.scien.cx/2025/09/07/dataverse-internals-how-to-get-the-sitemap-of-a-given-model-driven-app-%f0%9f%a4%94/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.