microsoft / microsoft/Power-CAT-Copilot-Studio-Kit
Bug: SharePoint Synchronization flow passes full URL instead of file name to x-ms-file-name causing truncation error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 450
- Forks
- 95
- Avg merge
- 26m
- Merged PRs (30d)
- 5
Description
Description
Dataverse File Name Truncation Error
In the child flow Sharepoint Synchronization | Synchronize files to Agent (Child), the file upload actions pass full SharePoint web URLs/paths to the Dataverse parameter x-ms-file-name instead of just the isolated file name.
Because Dataverse enforces a hard 255-character limit on the underlying FileAttachmentBase.FileName column, any document with a long SharePoint path or URL fails with a 400 Bad Request / 0x80090429 truncation error.
Flow & Component
- Solution: Copilot Studio Kit (
CopilotStudioAccelerator) - Flow Name:
Sharepoint Synchronization | Synchronize files to Agent (Child) - Actions Affected:
Upload_a_fileUpload_page_as_file
Root Cause Details
Upload_a_file action
- Current Mapping:
"x-ms-file-name": "@items('Apply_to_each_file')?['{Link}']" - Issue:
{Link}passes the full web URL (e.g.https://tenant.sharepoint.com/sites/.../file.docx?d=...), which frequently exceeds 255 characters. - Expected Mapping:
@items('Apply_to_each_file')?['{FilenameWithExtension}']
Upload_page_as_file action
- Current Mapping:
"x-ms-file-name": "@{items('Apply_to_each_File_Indexer_Configurations')?['cat_siteaddress']}/SitePages/@{items('Apply_to_each_page')?['FileLeafRef']}" - Issue: Prepends the full site path to the page leaf reference.
- Expected Mapping:
@items('Apply_to_each_page')?['FileLeafRef']
Error Response
{
"error": {
"code": "0x80090429",
"message": "String or binary data would be truncated..."
}
}
Suggested Fix
Update the managed flow definition so that both Upload_a_file and Upload_page_as_file map x-ms-file-name exclusively to file names ({FilenameWithExtension} / FileLeafRef) rather than full URLs or site paths.
Steps to reproduce
Steps
- Configure SharePoint Synchronization for a document library where full file links exceed 255 characters.
- Trigger the sync process via
Sharepoint Synchronization | On Demand. - Inspect the child flow run under
Upload_files_to_Copilot_Studio>Upload_a_file. - Observe the flow failure on the Dataverse file upload step with error
0x80090429.
Expected behavior
Child flow runs successfully for file sync
Actual behavior
Flow fails to finish syncing files
Environment
No response
Additional context or logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.