Update PDF Data
Applies new values to interactive form fields and XMP/document metadata in a PDF and returns the modified file.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Document | File content | Yes | .pdf file content (e.g. output of a “Get file content” action from SharePoint or OneDrive). |
| Fields | Array of Objects | No | List of form fields to update. Each object must include: • Name: form field name • Value: new value |
| Metadata | Array of Objects | No | List of metadata entries to update or create. Each object must include: • Name: metadata key • Value: new value |
Returns
| Name | Type | Description |
|---|---|---|
| File content | String (base64‑encoded) | Base64‑encoded bytes of the updated .pdf file, ready for use by downstream actions. |
Examples
A PDF form containing two text fields:
- first_name (textbox)
- last_name (textbox)
And XMP metadata:
xmp:Departmentxmp:Created
{ "Fields": [ { "Name": "first_name", "Value": "Jane" }, { "Name": "last_name", "Value": "Doe" } ]
"Metadata": [ { "Name": "xmp:Department", "Value": "Marketing" }, { "Name": "xmp:Updated", "Value": "2025-07-17T10:00:00Z" } ]}The action returns the same PDF file bytes, but with:
- The first_name field set to
"Jane" - The last_name field set to
"Doe" - The
xmp:Departmentmetadata updated to"Marketing" - A new metadata entry
xmp:Updatedset to"2025-07-17T10:00:00Z"
Troubleshooting
Click to expand common errors and fixes
Document Missing, Truncated or Invalid
Cause:
Document payload is empty, truncated, or not a valid PDF.
Fix:
- Provide the complete PDF binary or base64.
- Verify it opens successfully in a PDF reader.
PDF Is Password-Protected, Encrypted or Permission-Restricted
Cause:
Encryption or permission flags prevent modifications.
Fix:
- Use an unencrypted copy with modification permissions.
- Remove password protection or adjust permissions before updating.
Fields Array Supplied but No Fields Were Updated
Cause:
Field names do not match the form field names (case or spacing differences), fields were flattened, or names are duplicated.
Fix:
- Confirm the exact field names used in the PDF.
- Ensure the PDF contains interactive form fields (not flattened).
- Make names unique if duplicates exist, or target fields by full qualified name.
Field Value Type Mismatch or Invalid Format
Cause:
A value incompatible with the target field type was supplied (e.g. supplying a string for a checkbox, date format mismatch).
Fix:
- Supply values matching the field type.
- Normalise booleans (true/false) for checkboxes, and format dates consistently.
- If the form expects specific export strings, use those values.
Checkboxes / Radio Buttons Set to Vendor-Specific Values
Cause:
Checkbox or radio widgets encode On/Off, custom export values, or vendor-specific strings.
Fix:
- Inspect the PDF form to determine the export values for options and supply those exact values.
- Normalise values downstream if needed.
Flattened Forms (Fields No Longer Interactive)
Cause:
Fields were flattened into page content and are no longer editable. The action cannot update flattened content.
Fix:
- Use a version of the PDF that preserves interactive fields.
- If only flattened files are available, values must be altered by editing page content.
Metadata Keys Not Created or Updated as Expected
Cause:
Key names are malformed, use non-standard XMP keys, or have encoding issues.
Fix:
- Use standard XMP or document metadata key names and UTF-8 for values.
- Validate metadata with a PDF metadata inspector.
Digital Signatures Invalidated After Update
Cause:
Modifying fields or metadata breaks existing digital signatures.
Fix:
- Understand that updating the PDF will typically invalidate signatures.
- Re-sign the document after making changes or apply incremental signing strategies if necessary.
Concurrent Edits or File Locks Cause Write Failures
Cause:
The PDF is open or locked by another process or concurrently modified.
Fix:
- Ensure no exclusive locks exist and perform updates on a stable copy.
- Retry after ensuring exclusive access.
Output Corrupted, Truncated or Fails to Open
Cause:
Returned payload is truncated or there was an encoding error during write.
Fix:
- Verify the returned base64 decodes successfully and the file opens.
- Re-run with a minimal PDF to determine reproducibility.
Generic Runtime or Transient Error
Cause:
Malformed inputs, intermittent engine failure, or unexpected internal error.
Fix:
- Reproduce with a minimal sample PDF and a single field update.
- Validate input structure (Fields and Metadata) and retry to rule out transient issues.
Quick Checklist
- Document is the complete PDF binary or base64 (not a path or URL).
- Supplied Fields use exact form field names and values appropriate to the field type.
- Metadata keys are valid XMP or document keys and values use UTF-8.
- PDF is not password protected or permission-restricted.
- Fields are interactive (not flattened) and not part of an unsupported XFA dynamic form.
- Regenerate appearance streams or reopen the PDF in a reader if visual values do not refresh.
- Be aware updates typically invalidate existing digital signatures - re-sign if required.
- If output is invalid, reproduce with a minimal redacted PDF and the exact Fields or Metadata payloads used - those inputs are necessary to diagnose the issue.