Skip to content

[Bug] getReferencedEntity() returns 404 "List not found" for SharePoint document-library-backed data sources #441

Description

@magcube1132-dev

Environment

  • @microsoft/power-apps: 1.3.0
  • @microsoft/power-apps-cli: 1.0.0
  • @microsoft/power-apps-vite: 1.0.2
  • Connector: shared_sharepointonline
  • Data source: SharePoint document library (not a plain list)

Bug Description

getReferencedEntity() on a generated service returns a 404 "List not found" error when the underlying data source is a SharePoint document library with a Choice column, following exactly the pattern documented in How to: SharePoint operations under "Referenced entities (Choices / Lookup / Person)".

Steps to Reproduce

  1. Add a SharePoint document library with a Choice column as a data source:
    pa app add data-source --connector sharepointonline -c <connection-id> -d "<site-url>" --table "<document-library-list-guid>"
    
  2. In the generated <Table>Service.ts, call:
    await <Table>Service.getReferencedEntity("", "Status");
    (or any other Choice column's internal field name)
  3. Inspect the network request in browser DevTools.

Expected Behavior

The call resolves and returns the defined Choice values for the column (per the documented { value: [...] } shape).

Actual Behavior

Every call 404s:

{"status":404,"message":"List not found...","status":404,"requestId":"..."}

This reproduces for every Choice column tested (3 different fields) on the same document-library-backed data source. The same data source's create/update/get/getAll methods all work correctly against the same list — only getReferencedEntity fails.

Suspected Root Cause

Likely the same class of bug as #274 ("dataset parameter dropped for SharePoint operations that require it", fixed in @microsoft/power-apps v1.1.1 for ODataStyleGetTables/CreateFile). Per that issue's comment thread, getReferencedEntity was added after that fix, and may not have received the same fix — the dataset/table-routing parameter likely is not threaded through correctly for this specific operation when the underlying source is a document library rather than a plain list.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions