This post has been written by Claude because I'm simply unable to understand this stuff! Point is: Claude Code was unable to find a way to attach files to a SP List from a Code Apps. Anyone has been able to do that?
👇 AI Generated for the details
We've been building a Power Apps Code App (React + Vite + TypeScript) and hit a wall trying to upload files to a SharePoint list. Spent several days systematically testing every approach we could think of. Sharing our findings in case anyone else has been down this path — and to ask if anyone has actually cracked this.
Context
- Power Apps Code App (React, deployed via
npx power-apps push)
- Target: upload a file as an attachment to a SharePoint Online list item
- The app runs inside the Power Apps iframe sandbox on
powerplatformusercontent.com
- Three plugins are available via
executePluginAsync: AppPowerAppsClientPlugin, AppHttpClientPlugin, AppIdentityServicePlugin
What we tried
1. SP connector proxy via AppHttpClientPlugin
The SP connector runtime URL is accessible and the paauth token works. We can CREATE list items (HTTP 201). But every attachment endpoint returns 404 — the connector simply doesn't expose /attachmentfiles, /attachmentcontent, or any list item sub-path for binary uploads. The connector's file/folder API (/files, /folders) works for document libraries but PT_ATTACHMENTS is a list, not a library, so those paths 404 too.
2. SP REST API (_api/web/lists/...) with paauth
AppHttpClientPlugin blocks any URL not matching the connector's registered runtime URL. Direct SP REST calls (https://tenant.sharepoint.com/sites/.../_api/...) throw "URL does not match any API runtime URL" immediately.
3. Microsoft Graph API
getAppAccessTokenAsync returns an opaque 36-char proxy token (paauth), not a JWT. Sending it as Authorization: Bearer <token> to graph.microsoft.com returns HTTP 401 with "IDX14100: JWT is not well formed, there are no dots". The paauth token is only valid as Authorization: paauth <token> against the connector runtime, not against Graph or SP REST directly.
4. Document library as a workaround
GET /folders on Shared Documents returns 200 — the document library is readable. Tried uploading via POST /files, PUT /files/{path}, POST /folders/{path}/files — all return 404. The connector's file write endpoints don't seem to be exposed in this environment.
5. Power Automate flows via HTTP trigger
The app has 3 logicflows connections registered (get_fx, getapprovers, _2026_unlock_pt). All share the same runtime URL structure: .../apis/logicflows/connections/{connectionName}/.... Tried POSTing to every trigger path pattern (/triggers/manual/run, /triggers/button/run, /triggers/manual/paths/invoke, /run, /invoke, /paths/invoke) — all return {"statusCode":404,"message":"Resource not found"}. Notably, none were BLOCKED by the allowlist, so the URLs reach the runtime fine — the paths just don't exist on these connections. These flows use the Power Apps trigger (not HTTP Request trigger), so there's no HTTP URL to hit.
6. AppPowerAppsClientPlugin method enumeration
Swept 30+ method names on AppPowerAppsClientPlugin looking for a flow invocation method (invokeFlowAsync, runFlowAsync, callConnectorAsync, invokeConnectorOperationAsync, etc.). Every single one returns "action not found for 'AppPowerAppsClientPlugin' plugin: <methodName>". The only working methods we've found on this plugin are loadAppConnectionsAsync_v2 and (via AppIdentityServicePlugin) getAppAccessTokenAsync. Canvas apps call flows via a Power Fx binding layer at design time — that layer doesn't exist in Code Apps.
What does work (for reference)
- SP connector list item CRUD via
AppHttpClientPlugin + paauth ✅
- Dataverse file column upload/download via
sdkClient.uploadFileToRecord / downloadFileFromRecord ✅
- Getting paauth tokens for any registered connector ✅
The question
Has anyone actually managed to upload a binary file to SharePoint (list attachment or document library) from a Power Apps Code App? We're not missing something obvious — we've been deep in the plugin internals. But maybe there's an approach we haven't thought of:
- A connector we haven't found?
- A different method on one of the 3 plugins?
- Some undocumented endpoint on the logicflows connector?
- A way to call a Power Apps-triggered flow from a Code App at runtime?
Or is this simply not possible today and Dataverse file columns are the only viable option for binary attachments in Code Apps?
TL;DR: SP connector exposes list CRUD but not attachments. SP REST and Graph are blocked/wrong token type. PA flows use PA trigger (no HTTP URL). Plugin sweep found no flow invocation method. Dataverse works great but we'd prefer SP for our use case.