With HarePoint Workflow Extensions, it is possible to easily convert an InfoPath form to PDF, with just a single workflow action:
Beside just the conversion, it is often convenient to transfer metadata from an InfoPath form to the target document library so that users could then search the PDF form by metadata. This can also be achieved with HarePoint Workflow Extensions and QueryXML action.
This is an example of a form:
An XML file for this filled form looks as follows:
You can use Query XML action to retrieve data from the form. In order to use this action, you need to know XPATH for each data field you are going to transfer. It can be obtained from InfoPath application as follows:
In this example, XPATH for Birthday field is /my:myFields/my:Birthday
Here is an example of a workflow that retrieves metadata from an InfoPath form (FirstName and LastName fields), converts this form to PDF, and then updates document library fields Contact First Name and Contact Last Name accordingly:
The three important actions in this workflow are explained below:
- Get Properties Step
The workflow starts on a list item with InfoPath form. First, it reads the entire XML content of a current form, and then retrieves First Name and Last Name fields’ values from it using Query XML and their XPATHs.
- Building a URL of an output PDF file
An important step is to get a URL to the output PDF file.The URL consists of three parts: target document library URL (stored in Library Url variable); the file name which is the same as the original form name, so it is Current Item:Name lookup; and a .pdf file extension:
- Updating document library fields
Finally, the workflow updates the fields of a document library for the PDF document. For that, Update List Item at URL action from HarePoint Workflow Extensions is used, as follows:
In this example, Contact First Name and Contact Last Name are the metadata fields in the document library that will receive First Name and Last Name values from an InfoPath form accordingly.
In this article, we have seen that it’s not only possible to just convert an InfoPath form to PDF with HarePoint Workflow Extensions, but also various further scenarios can be accomplished. In particular, the metadata from an InfoPath form have been transferred to a document library fields, making document search much more efficient.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?