# Fill PDF Form

The Fill PDF Form Data Operation enters data into the fillable fields of a PDF. This can be used to create a PDF Form for the user with entries pre-filled with data so they don't have to enter it themselves. For a quick example of a PDF with fillable forms, see how this [form from the CA DMV](https://www.dmv.ca.gov/portal/uploads/2020/06/reg227.pdf) is used in this Building Byte video:

\[block:embed] { "html": "\<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2gCopCxe6KQ%3Ffeature%3Doembed\&display\_name=YouTube\&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2gCopCxe6KQ\&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2gCopCxe6KQ%2Fhqdefault.jpg\&key=7788cb384c9f4d5dbbdbeffd9fe4b92f\&type=text%2Fhtml\&schema=youtube" width="854" height="480" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true">", "url": "https://www.youtube.com/watch?v=2gCopCxe6KQ", "title": "Filling a PDF", "favicon": "https://www.google.com/favicon.ico", "image": "https://i.ytimg.com/vi/2gCopCxe6KQ/hqdefault.jpg", "provider": "youtube.com", "href": "https://www.youtube.com/watch?v=2gCopCxe6KQ", "typeOfEmbed": "youtube" } \[/block]

PDF Forms can be created in [Adobe Acrobat](https://helpx.adobe.com/acrobat/using/creating-distributing-pdf-forms.html) or any other PDF creation tool.

![organizing info](https://3333962744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbnBffrSN2FHLC5cM89AM%2Fuploads%2Fgit-blob-cad34626c4dada0cd6c3c81d282d615d536f442b%2Fthe-fill-pdf-form-data-operation-v183-0.gif?alt=media)

## Use Cases

* Create a fillable PDF form that has known user information pre-filled
  * The user can still change the fields if needed

## Data Operation Properties

### Filename

Expects type `text`.

The filename of the final generated PDF.

### PDF File Asset Identifier

Expects type `asset`.

An Asset object that contains the PDF form. This will usually look like **URI\_TO\_ASSET()**. For more information, see [Working with Files & Media](../building-apps/assets/working-with-files-and-media).

### Data to Fill

Expects type `object`.

The data to fill into the fillable fields of the PDF. For instance, to fill in the key `FirstName` with **Bob**, and `LastName` with **Johnson**, you would use:

```javascript
{  
  "FirstName" : "Bob",  
  "LastName" : "Johnson"  
}
```

To see the name of the keys in the fillable PDF, use Adobe Acrobat or whatever PDF editing tool is used by your organization.&#x20;

> 📘 PDF Fill Considerations - If the object being passed has `NULL` fields, "NULL" will be filled into the input on the PDF
>
> * If the object being passed to the Data Operation has a key that doesn't match any of the fields in the PDF, the Data Operation will error out
> * If the object being passed doesn't include all of the fields, the PDF will still accept the payload, but the fields that weren't included will be blank and editable

#### Pass a signature to a PDF

When creating a signature field on a PDF form, it is recommended to create the signature field as a type `text` in the PDF, and then pass the `downloadUrl` in the data operation.

### Asset Setting

#### Scope

Determines the scope of the download link. This can either be **APP** or **SESSION**. If the generated PDF should be accessible from other user sessions, choose **APP**. Otherwise, if the created PDF is unique per customer, choose **SESSION**.

#### Visibility

Determines the visibility of the download link. This can either be **GLOBAL**or **PRIVATE**. If the generated PDF has sensitive customer information, it should be marked as **PRIVATE**. With **PRIVATE**, the PDF will have an extra layer of access protection. The generated URL will have the necessary credentials to access the file.

> 📘 The generated URL for the PDF allows anyone to access the file. The URL should only be shown to the customer that the PDF belongs to.

#### Download Url Expiration

Expects type `number`.

Only appears when **Visibility** is marked **PRIVATE**, as **Global** Assets do not expire.

Determines how long the download link to the file is available. For instance, if **30 Minutes** is given, the download link will no longer work after thirty minutes. **Private** Assets must expire after a maximum of 7 days.

#### Hash Type

The hash type selected from the dropdown will automatically generate a hash when files are uploaded to the Asset store.

## Run Results

A Variable is automatically created to hold the results of this Operation. This result will be an object with several keys that describe the generated PDF.

The most important of these keys is `downloadUrl`, which is a URL that downloads the generated PDF when accessed.
