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:
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
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.
