Hey all,
I ran into an issue recently using the PDM Pro REST API. I recently built a tool to pull all pdf’s with a certain variable value, which then allows the user to update other data card variables for a file. The issue is that it seems the REST API method has a character limit for variable value updates and fails with “String or binary data would be truncated”. The data card save step succeeds but the checkin step fails with error code 500.
The exact same variable values can be saved successfully through the SolidWorks PDM desktop client, as well as the Web2 Viewer, so this is specific to the Web API’s checkin path.
Short variable values (e.g., updating Description to a few words) save and check in fine through the
same flow. The failure only occurs when a variable value exceeds ~100 characters. This affects our custom text variables which store comma-separated lists of part numbers — often 500-800+ characters long.
Environment
- SolidWorks PDM Professional Web API (REST)
- IIS-hosted on Windows Server
Steps to Reproduce
- Authenticate via POST /api/{vault}/authenticate
- Check out a file via POST /api/{vault}/files/CheckOut
- Save data card with a long variable value via POST
/api/{vault}/files/{fileId}/{folderId}/datacard — this succeeds- Add file to changeset via PUT /api/{vault}/checkin/addfiles/0
- Build reference tree via GET /api/{vault}/checkin/buildtree/{changesetId}
- Check in via PUT /api/{vault}/checkin/{changesetId} — this fails with 500
The API returns:
{
“FileName”: null,
“DocumentId”: 0,
“Status”: 3,
“StatusTime”: “2026-04-03T19:32:19.2171577Z”,
“Progress”: 0,
“ErrorMessage”: “An error occurred, see the log file”
}
PDM Web API log file shows something along the lines of…
ERROR: String or binary data would be truncated in table
‘tempdb.dbo.#VariablesData______…’, column ‘Value’.
Truncated value: ‘E-RMSOD-30-BW-EM-EXTDB-180D-G2,E-RMSOD-30-BW-EM-EXTDB-20IN-180D-G2,
E-RMSOD-30-BW-EXTDB-180D-G2,E-RMS’.
The statement has been terminated.
I’ve tried to update the text length validation for a data card field to have a max character limit of 99999, which doesn’t fix the issue. Is there somewhere else this text limit is set? Or is this an API limitation with how temp tables are built to process the checkin?