How to generate PDF document using workflow

Applies ToInformation Worker for SharePoint 2013/2016 and Cloud

This article explains how to create PDF form using PDFSF workflow actions and populate its fields with data from SharePoint list.

Step 1. Create a list

This list is used to initiate process of creating PDF forms using workflow actions. Once user creates new list item, workflow will be automatically executed to create new PDF form instance and populate it with data from this list item.

Navigate to Site contents → Add an app → Custom List → Pick a name and click Create:

In this example list has name “Employees”.

1.1 Navigate to the newly created list and add new columns by clicking “edit this list”:

1.2 Click on “+” button to add all necessary columns:

In this example following columns are used: “Phone Number”, “First Name” and “Last name”:

Step 2. Create a template

In this template following fields are used:

  • First Name (TextField1);
  • Last Name (TextField2);
  • Phone Number (TextField3).

These fields will be populated by workflow once new PDF form instance will be crated.

Step 3. Deploy the template

Click on “Publish” button, which is located in the bottom right corner to deploy template to the SharePoint library:

Step 4. Create workflow using SharePoint Designer

This guide covers two possible platform types for the workflow: 2010 and 2013.

Step 4.1. Platform Type: SharePoint 2013 Workflow

1) Navigate to Workflows → List Workflows → in dropdown select previously created list (Employees):

2) Name workflow and click OK:

3) Click on Stage first and select “Core Actions: Build Dictionary”:

Click on “this(in created dictionary) → in appeared window click “Add…” button, give a name, then click on function.

NOTE: name should match with Text Field name in the template.

In “Field from source” dropdown choose the column name in your list which is connected to the field (column “First Name” is connected to “TextField1” field in the template):

When done press OK.

4) Repeat steps from above for two remaining fields and columns. As the result, it should look like following:

5) Add “PDF Share Forms IW: Create PDF Form Instance” underBuild Dictionary” action:

Make following adjustments to the action:

  • Click on “TemplateName”, write the template name you created in first step;
  • Click on “FieldValues”, select the dictionary created earlier;
  • Click on “SelectUser”, choose user who will see the result of applied workflow In PDF document.

As the result it will look like following:

NOTE: make sure that appropriate names of template and dictionary are used.

6) Click on “Transition to stage” and select action “Common Flows: Go to a stage”. Click on “a stage” in appeared action, select “End of Workflow”:

Step 4.2. Alternative step: Platform Type SharePoint 2010 Workflow

1) Name workflow and click OK:

2) Click on Step first and select “PDF Share Forms IW: Create new PDF form document”:

Click on “this document library” to configure action.

3) In appeared window in the “List” dropdown select deployment library. In appeared “Value” of “Content Type ID” select previously published template from step 2:

Double click on “Path and Name” and give a name for PDF form, which will be created by this workflow:

In this case form name is “workflow”.

4) Add action “PDF Share Forms IW: Update field value in PDF form”:

Make following adjustments to the action:

  • Click on “field”, select function and type in the name of the text field from PDF form (TextField1);
  • Click on “new value”, select function and in “Field from source”: select the name of the column in the “Employees” list (First Name).
  • Click on “this”, in “List” dropdown select deployment library:

In “Field” dropdown select “Name (for use in forms)”. In “Value” field put name of created PDF from with “.pdf” extension (in this example form name is “workflow.pdf”).

5) Repeat steps from above for remaining two fields and columns, so as the result it will look like following:

Step 5. Set workflow to execute automatically

Navigate to Workflow Settings → in Start Options select “Start workflow automatically when an item was created”.

Save and Publish created workflow.

Step 6. Open SharePoint list which was created on step 1 (Employees)and “add new item”:

Once item is added, workflow will start execution automatically:

Step 7. The result

Navigate to the library where PDF template was initially published:

Open document by clicking on it:

New PDF document appeared in deployment library with updated information from the list.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk