Fill a PDF Form

Overview

The 'Fill a PDF Form' Power Automate action populates the PDF Form provided with the JSON form data provided.

Whilst this action supports both XFA and (Adobe) Acroforms, the action provides greater support for changing data within (Adobe) Acroforms.

Example Flow

Please refer to the following article showcasing the 'Fill a PDF Form' Power Automate action: Fill a PDF Form with Microsoft Power Automate

Credit Count

This action consumes 1 credit per operation.

Note, different Encodian actions can consume different number credits. Please always check the action specific documentation and read What is an Encodian Action for a full description of how credits are consumed.

Default Parameters

The default 'Fill a PDF Form' flow action parameters are detailed below:

  • File Content: A Base64 encoded representation of the PDF Form file to be processed
  • Form Data: The JSON data to populate with the PDF Form with

Form Data Guidance

Data should be provided aligned to this simple schematic:

{
    "fieldName":"value",
    "fieldName":"value",}

The field name must refer to the name of the field from within the PDF Form, for example:

mceclip0.png

The following JSON should be used to update the value of the field depicted above:

{
    "Text1":"Updated Value"
}

Checkbox Fields

The following JSON should be used to update the value of a checkbox field, where true is equal to checked and false is equal to unchecked.

{
    "CheckBoxFieldName1":true
"CheckBoxFieldName2":false
}

Multi-Select Fields

The following JSON should be used to update drop-down lists which allow multiple options to be selected:

{
    "ListBoxFieldName1":"Option 1, Option 3, Option 9"
}

Image Field

The following JSON should be used to add an image file to an image placeholder within a PDF Form:

{
   "image":"<base64>"
}

To obtain the base64 value of the Power Automate 'File Content' property use the base64() expression:

2023-11-07_09-24-20.gif

Radio Button Option Fields

The following JSON should be used to update a radio button group, where the value specified maps to the radio button selected. For example;

{
    "RadioButtonOptionGroup1":"3"
}

mceclip1.png

NOTE: The group name should be used as the field name value and not the individual field name of the targeted radio button.

JSON Validation:

We recommend the following website for validating your JSON data: https://jsonlint.com/

Return Parameters

The 'Fill a PDF Form' flow action returns the following data. 

Action Specific Return Values

  • File Content - The processed PDF Form (Base64)

Standard Return Values

  • OperationId - The unique ID assigned to this operation.
  • HttpStatusCode - The HTTP Status code for the response.
  • HttpStatusMessage - The HTTP Status message for the response.
  • Errors - An array of error messages should an error occur.
  • Operation Status - Indicates whether the operation has been completed, has been queued or has failed.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk