web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Amira Beldjilali Profile Picture
    on at
    RE: Virtual Table Error: APIM request was not successful, no primary key

    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

  • Pawel Szymczyk Profile Picture
    5 on at
    RE: Virtual Table Error: APIM request was not successful, no primary key

    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.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Virtual Table Error: APIM request was not successful, no primary key

    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

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
DAnny3211 Profile Picture

DAnny3211 191

#2
Sahan Hasitha Profile Picture

Sahan Hasitha 152

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 129 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans