Skip to main content

Notifications

Community site session details

Community site session details

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

Retrieve all tables from solution

(0) ShareShare
ReportReport
Posted on by 92

Hello,

I want to create a web API call to retrieve all tables from a solution by the solution's unique name. For example, I tried using https://[organization url].crm4.dynamics.com/api/data/v9.2/solutions?$filter=(endswith(uniquename, 'Solution Name')), but I cannot retrieve the tables from the solution. I got the table's unique identifier, but I want to get the table's logical name. Can someone help me with my quest? 

Thank you!

  • Suggested answer
    Guido Preite Profile Picture
    54,077 Moderator on at
    RE: Retrieve all tables from solution

    I don't know if you can do in a single query, but first one will be to retrieve the solution components (type entity) with the filter or the guid of the solution, for example:

    /api/data/v9.2/solutioncomponents?$select=componenttype,objectid&$filter=(_solutionid_value eq cd1014b3-34e5-454f-96b1-d2a23855d5ea and componenttype eq 1)

    in this way inside the column objectid you get the IDs of the tables involved.

    At this point you can query or the metadata or the Entity table. With the Entity table will be something like:

    /api/data/v9.2/entities?$select=entityid,logicalname&$filter=Microsoft.Dynamics.CRM.In(PropertyName='entityid',PropertyValues=['409c8fb7-cd2e-4b10-b18d-1a52509e778d','cdacaa99-750e-47b8-ba95-13855ff0360f'])

    a note here: I am doing a IN operator to a primary key, is something that works but I can't guarantee 100%, the alternative is to create a OR condition with all the values, something like

    /api/data/v9.2/entities?$select=entityid,logicalname&$filter=(entityid eq 409c8fb7-cd2e-4b10-b18d-1a52509e778d or entityid eq cdacaa99-750e-47b8-ba95-13855ff0360f)

    Because is a GET request if you your values create a string way too long you need to batch the request to be a POST.

    Another safe approach is to retrieve all the entities first, cache the values and after map with the objectid values you get from the solution components. (really depends on what you are doing here)

    hope it helps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,206 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans