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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Virtual Table Error: APIM request was not successful, no primary key

(0) ShareShare
ReportReport
Posted on by 5

Hi,

 

I'm working with Virtual Tables (entities), following documentation I have created tables using SQL Server connector.

 

It properly displays a grid with data, but the problem is when I try to open the item details page, which starts loading the details page and displays an error: "APIM request was not successful: BadRequest: No primary key exists in table".

 

But I do not understand why the error says there is no primary key if I specifically provided it during virtual table creation. I have provided Id (GUID) for "Primary key of the Virtual Entity" and Name (string) for "Primary field of the Virtual Entity".

 

Based on that information it did create a virtual entity, which according to documentation should work as any other table.

 

So my question is what can cause the problem and how can I fix it?

Thanks in advance.

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Pawel,

    The following are limitations for each data source.

    https://docs.microsoft.com/en-us/power-apps/maker/data-platform/create-virtual-tables-using-connectors?tabs=sql#for-each-data-source 

    pastedimage1662608390172v1.png

  • Pawel Szymczyk Profile Picture
    5 on at

    Hi Leah,

    Thanks for your suggestion.

    Indeed its a limitation, when I directly have used a table to connect to, it was working without problems, but the idea and the problem is when using SQL view, D365 cannot see its primary key (which does not exists, cos its a view) so it prompts an error.

  • Amira Beldjilali Profile Picture
    on at

    Hello,

    Do you have a Primary Key in the SQL table?

    You probably need to set it there:

    ALTER TABLE 
    
    ADD CONSTRAINT  PRIMARY KEY ();

    Regards,

    Amira

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans