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.

  • 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans