Title: tables.create() does not expose primary column logical name, causing CRUD payload confusion · Issue #148 · microsoft/PowerPlatform-DataverseClient-Python · GitHub
Open Graph Title: tables.create() does not expose primary column logical name, causing CRUD payload confusion · Issue #148 · microsoft/PowerPlatform-DataverseClient-Python
X Title: tables.create() does not expose primary column logical name, causing CRUD payload confusion · Issue #148 · microsoft/PowerPlatform-DataverseClient-Python
Description: Summary When using tables.create() to create custom tables and then dataframe.create() to populate records, it is unclear what column logical names to use in the record payload. The SDK's tables.create() documentation does not specify th...
Open Graph Description: Summary When using tables.create() to create custom tables and then dataframe.create() to populate records, it is unclear what column logical names to use in the record payload. The SDK's tables.cr...
X Description: Summary When using tables.create() to create custom tables and then dataframe.create() to populate records, it is unclear what column logical names to use in the record payload. The SDK's table...
Opengraph URL: https://github.com/microsoft/PowerPlatform-DataverseClient-Python/issues/148
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tables.create() does not expose primary column logical name, causing CRUD payload confusion","articleBody":"## Summary\r\n\r\nWhen using `tables.create()` to create custom tables and then `dataframe.create()` to populate records, it is unclear what column logical names to use in the record payload. The SDK's `tables.create()` documentation does not specify the resulting logical names that Dataverse assigns, leading to confusion and 400 errors.\r\n\r\n## Problem\r\n\r\nAfter calling `tables.create(\"demo_abc123_Customer\", {\"demo_abc123_Customer_Revenue\": \"money\"})`, the resulting column's **schema name** is `demo_abc123_Customer_Revenue`, but the **logical name** (used in CRUD payloads, `$select`, `$filter`, etc.) is `demo_abc123_customer_revenue` (fully lowercased).\r\n\r\nHowever, the default **primary column** created automatically has schema name `demo_abc123_Name` with logical name `demo_abc123_name` -- NOT `demo_abc123_customer_name`. The prefix for the primary column is the **customization prefix** extracted from the table schema name, not the full table name.\r\n\r\nThis means:\r\n- Custom columns defined by the user: logical name = lowercase of passed schema name (e.g., `demo_abc123_customer_revenue`)\r\n- Default primary column: logical name = `{customization_prefix}_name` (e.g., `demo_abc123_name`)\r\n- There is no documentation or return value from `tables.create()` that tells the user what primary column logical name was created\r\n\r\n## Steps to Reproduce\r\n\r\n```python\r\nfrom PowerPlatform.Dataverse.client import DataverseClient\r\n\r\nwith DataverseClient(url, credential) as client:\r\n # Step 1: Create table\r\n result = client.tables.create(\r\n \"demo_abc123_Customer\",\r\n {\"demo_abc123_Customer_Revenue\": \"money\"},\r\n )\r\n\r\n # Step 2: Try to create a record -- what is the name column called?\r\n import pandas as pd\r\n df = pd.DataFrame([{\r\n \"demo_abc123_Customer_name\": \"Contoso\", # WRONG - 400 error\r\n # \"demo_abc123_name\": \"Contoso\", # CORRECT - but not obvious\r\n \"demo_abc123_Customer_Revenue\": 5000000,\r\n }])\r\n client.dataframe.create(\"demo_abc123_Customer\", df)\r\n # Error: Invalid property 'demo_abc123_customer_name'\r\n```\r\n\r\n## Expected Behavior\r\n\r\nEither:\r\n1. **`tables.create()` should return the primary column logical name** in its response (the `TableInfo` already has `columns_created` but it doesn't include the auto-created primary column)\r\n2. **Documentation should clearly state** that the primary column logical name follows the pattern `{customization_prefix}_name` where the prefix is extracted from the table schema name\r\n3. **Consider adding a `primary_column_name` field** to the `TableInfo` return type\r\n\r\n## Actual Behavior\r\n\r\n- `tables.create()` returns `TableInfo` with `columns_created` listing only explicitly defined columns, not the auto-created primary name column\r\n- No documentation explains the primary column naming convention\r\n- Users have to query entity metadata (`EntityDefinitions`) to discover the primary column logical name\r\n\r\n## Related Issues\r\n\r\n- #76 (Better data type specification) -- related to column definition UX\r\n- #77 (@odata.bind problem with same column and table names) -- related to column naming confusion\r\n\r\n## Context\r\n\r\nDiscovered while building the pro-dev quick start example (`examples/advanced/prodev_quick_start.py`) which creates 4 custom tables and populates them via `client.dataframe.create()`. The example could not reliably construct record payloads because the primary column logical name was not discoverable from the SDK.\r\n\r\n## Suggested Fix\r\n\r\n1. Include the primary column logical name in `TableInfo.columns_created` (or a new `primary_column` field)\r\n2. Add a note in `tables.create()` docstring explaining: \"The default primary column logical name is `{prefix}_name` where `{prefix}` is the customization prefix from the table schema name\"\r\n3. Consider a `tables.get_columns(table_name)` convenience method that returns column metadata including logical names\r\n","author":{"url":"https://github.com/saurabhrb","@type":"Person","name":"saurabhrb"},"datePublished":"2026-03-17T16:33:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/148/PowerPlatform-DataverseClient-Python/issues/148"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:52fa530a-dedb-af7d-a0af-ec045ff1205c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF6C:1B0B8D:153408:1D504D:6A4D17DF |
| html-safe-nonce | 0d87cb5f3c9fe767fb0beb056fe9cb47e772ba79a56c6085912baec3a2cb593b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjZDOjFCMEI4RDoxNTM0MDg6MUQ1MDREOjZBNEQxN0RGIiwidmlzaXRvcl9pZCI6IjgyODY4MTQyMTQ1NTY1NTUyMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 48273893cf37a035e979cbf3fc28e72acc580e9b70e84d45ce9e2a29b264a341 |
| hovercard-subject-tag | issue:4089712914 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/PowerPlatform-DataverseClient-Python/148/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f77286ab9d4d3e051eaf2c618f6f6b1e9fc6c1c9719c20831085ba3cc368ae35/microsoft/PowerPlatform-DataverseClient-Python/issues/148 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f77286ab9d4d3e051eaf2c618f6f6b1e9fc6c1c9719c20831085ba3cc368ae35/microsoft/PowerPlatform-DataverseClient-Python/issues/148 |
| og:image:alt | Summary When using tables.create() to create custom tables and then dataframe.create() to populate records, it is unclear what column logical names to use in the record payload. The SDK's tables.cr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | saurabhrb |
| hostname | github.com |
| expected-hostname | github.com |
| None | bcb4661e6fb4fe8b394c51ea02ccdb2236d40dc59afc75a3bbba50bf6517134c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/PowerPlatform-DataverseClient-Python git https://github.com/microsoft/PowerPlatform-DataverseClient-Python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 1042273116 |
| octolytics-dimension-repository_nwo | microsoft/PowerPlatform-DataverseClient-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1042273116 |
| octolytics-dimension-repository_network_root_nwo | microsoft/PowerPlatform-DataverseClient-Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width