--- title: "Set PDF Form Fields Dynamically" slug: "set-pdf-form-fields-dynamic" updated: 2023-01-12T15:43:36Z published: 2023-01-12T15:43:36Z canonical: "documentation.decisions.com/set-pdf-form-fields-dynamic" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Set PDF Form Fields Dynamic | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 7.12.0 | | **Location** | Data > PDF | The Set PDF Form Fields Dynamic step passes in a list of DataPairs where the Name is the Field Name, and the Value is an Object and updates a PDF FileData with those values. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Field Data | Names and Values of the Fields to set within the PDF file. | List of DataPair | | PDF File | File to set PDF fields on. | FileData | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | PDF File | File using the newly set PDF fields. | FileData | ## Example Inputs and Outputs | Field Data | PDF File | Output | | --- | --- | --- | | List of Data Pair | A PDF File | Successful PDF Output | | Null | A PDF File | EXCEPTION MESSAGE | | List of Data Pair | Null | EXCEPTION MESSAGE | | Empty List of Data Pair | A PDF File | Successful PDF Output | | List of Data Pair | CSV File or Excel File, or any file type other than PDF | EXCEPTION MESSAGE | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2023-01-11_14h52_42.png) --- ## Common Errors ### Field Data cannot be null The Field Data property must have Input Data, or the step will fail with the following Exception Message. ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Set PDF Form Fields Dynamic 1[SetPDFFormFieldsDynamic] in flow [Display Steps]: Field Data cannot be null. ---> DecisionsFramework.LoggedException: Field Data cannot be null. at DecisionsFramework.Design.Flow.CoreSteps.SetPDFFormFieldsDynamic.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace ``` ### PDF File cannot be null The PDF File property must have Input Data, or the step will fail with the following Exception Message. ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Set PDF Form Fields Dynamic 1[SetPDFFormFieldsDynamic] in flow [Display Steps]: PDF File cannot be null. ---> DecisionsFramework.LoggedException: PDF File cannot be null. at DecisionsFramework.Design.Flow.CoreSteps.SetPDFFormFieldsDynamic.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` ### Incorrect File Header This step requires a PDF file; if any other file type is used as the PDF File input, the following error will occur. To correct this, use a PDF file. ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Set PDF Form Fields Dynamic 1[SetPDFFormFieldsDynamic] in flow [Display Steps]: Incorrect file header ---> Aspose.Pdf.InvalidPdfFileFormatException: Incorrect file header at #=zrx8$vGff8rw0zOsJfXBx6dl$eHVthdMYUw==.#=zELiBKk0nn$NI() at #=zrx8$vGff8rw0zOsJfXBx6dl$eHVthdMYUw==..ctor(Stream #=zA6ZEq1c=, String #=zkZxG5Dc=, Boolean #=zFRe3SoGTg5hA) at Aspose.Pdf.Document.#=zyoo3pL0=(Stream #=z3RtBOxU=, String #=zkZxG5Dc=) at Aspose.Pdf.Document..ctor(Stream input) at DecisionsFramework.Utilities.Data.PDFUtility.GetPdfDocument(Stream stream) at DecisionsFramework.Utilities.Data.PDFUtility.GetFieldNames(FileData file, PdfFieldNameSortingMethod sortingMethod) at DecisionsFramework.Design.Flow.CoreSteps.SetPDFFormFieldsDynamic.Run(StepStartData data) at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData) at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ```