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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unable to choose Prima...
Power Apps
Unanswered

Unable to choose Primary Key during Virtual Table refresh

(3) ShareShare
ReportReport
Posted on by 6

Hi,

While we try to refresh the dataverse virtual table, on the screen where we need to choose the Primary Key and Primary Column, we are unable to see any fields populated under "Primary Key". Only "Primary Column" has most of the fields. Our actual MSSQL table has integer fields which used to appear under "Primary Key" field earlier. 

 

We need to get this fixed as soon as possible. Please help!

I have the same question (0)
  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @Ashwini_Raghave

    You cannot see anything in the list of primary keys because unfortunately there's a current constraint with Virtual Tables where the primary key needs to map to a GUID column in the external table. For more info, see limitations at: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/virtual-entities/get-started-ve#limitations-of-virtual-tables

    You can submit the feedback/idea at https://ideas.powerapps.com/d365community/mycontent/ and I'll vote! I agree it should be possible and a common scenario 🙂

    Cheers!

  • Viliam Juricek Profile Picture
    70 on at

    Hello @Ashwini_Raghave ,

    I have found same issue as you have, during last 2 weeks we've been creating Virtual Tables from Synapse Serverless without any issue. Today I needed to add another table and suddenly the wizard says table is missing primary key.

    Something must have changed in the wizard because for us there is no option to have primary key since Synapse SQL Serverless External Tables do not support constraints like this.

    I have found similar issue while searching: Unable to add on-premise SQL Server tables to Dataverse 

    There even is a video from MS showing Virtual Table creation from Synapse Serverless but this is currently not possible. Any table without primary key on datasource will fail the creation for me today.

    Build Power Apps from Azure Data Lake with Virtual Tables 

     

    @EricRegnier I see that you're using a different documentation page as reference. Have a look here, according to this documentation not having primary key on the source table is acceptable with some restrictions.

    Limitations and troubleshooting virtual tables with Power Apps - Power Apps | Microsoft Learn

     

    Someone from Microsoft should explain what happened here.

     

    BR

    Wiliam

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    @NHelgren 

  • matthhias Profile Picture
    48 on at

    Hi Eric, 

     

    there is obviously provided mixed information by Microsoft. I read the same, source you mentioned, but I also found detailed information on SQL connections that say that integer works as well for SQL Server:

    (typos are from the original source)

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/limits-tshoot-virtual-tables?tabs=sql#for-each-data-source

     

    • SQL virtual tables can use a GUID or an Integer field for the Primary Key for funn functionality.
    • SQL Server tables without primary keys: Any non-string field can be selected as the primary key. The virtual table should be created successfully. RetrieveMultiple will work, the other operations will fail with the following error message (coming from SQL connector): "APIM request wasn't successful: BadRequest: No primary key exists in table". For funn functionality a GUID or integerfield must be used as the primary key.

     

    I was able to build virtual tables from tables with integer primary keys without any problem, even from SQL views on these tables without any problem until some days ago.
    Now the same thing fails unfortunately.

    I posted it here:
    https://powerusers.microsoft.com/t5/Microsoft-Dataverse/I-can-t-add-a-SQL-virtual-table-view/m-p/2108647/highlight/true#M29186

  • MMCJF Profile Picture
    6 on at

    Hi,

     

    I am experiencing the exact same thing. I was able to create a virtual table from an SQl data source with an integer primary key without any problems a few weeks ago. However, when I tried creating a similar virtual table last week, I was not able to select any of the integer fields as primary key.

    Does anyone have an update on whether this is a bug?

  • Viliam Juricek Profile Picture
    70 on at

    The issue still persists however if anyone needs it really badly as we did (SAP integration) then there is a workaround.

     

    Since every table is just an xml object in customizations.xml and we already had a virtual table without primary keys, we only exported the solution and based on xml of existing virtual table created a definition of new table. It's not the most comfortable process but it works. You do need to create new guid for every form and saved query as well as sections of forms for the new virtual table and add it also into solution.xml as root component but it's manageable and after importing the modified zip of the solution, the new virtual table is fully functional.

    Hope if someone needs it as much as we did this will help.

    BR

    Wiliam

     

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hey @Wiliam_Juricek, do you try opening a MS support ticket? The MS virtual table product team usually provides great support... 

  • Tommy-Upton Profile Picture
    119 on at

    Any update on this?  It's still a problem it seems.

  • frederikbisback Profile Picture
    222 on at

    Any update on this topic? 

     

  • RonaldSmith Profile Picture
    10 on at

    Still having this problem. Documentation says integer pkeys should be fine, but after creating the virtual table no data can be displayed. I get the oh so helpful "Something went wrong" error. 

     

    To clarify, Power Apps appears to create the SQL-based virtual table successfully, but for whatever reason having the primary key as datatype INT results in the error. The only primary key datatype that I have been able to use is "uniqueidentifier". String GUIDs and any integer datatype fails.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard