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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 172

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans