As a follow-up to the previous article, “Generating a Microsoft Word Contract from Laserfiche Forms Data,” this post focuses on how Laserfiche can be used to capture a signature from a Laserfiche Form and insert it directly into a MS Word document!
In this month’s article, CDI’s Software Trainer, Kyle Knebel, will guide us through how to accomplish the insertion of a signature into a MS Word document. Most of these steps are outlined in the article linked above.
Kyle, what document type will you be showing us for the example today?
The steps included below will outline signatures on a Contract document.
1. Create your MS Word document.
a. First, you should get your document set up in MS Word.
b. For example, in the text area where the signature appears, enter the special word
“1CompanyName1”. We will later use the Find-Replace function to replace the boilerplate text with the actual name that was typed in Laserfiche Forms.
c. Following this same idea, we could add some text like “2EffectiveDate2” where we want to replace it with the actual contract effective date.
d. And the same for the expiration date, we could add some text like “3ExpirationDate3” where we want to replace it with the actual expiration date.
e.The signature field is going to be different. We need to use a MS Word Merge Field. You will place the merge field as desired, but it must have the following format. It must be prepended with “Image:”. For example, the field could be created called “Image:Signature1”. The colon is crucial.
i. To insert a Merge field, select the Insert Tab, then select the Field option from the Quick Parts Menu option in the Ribbon Bar.
or
ii. Next, choose the “MergeField” type and enter the Field Name in the top-right corner. It must be in the format of “Image:{anything}”. For example, “Image:Signature1” would be entered without quotes.
f. Save the new MS Word document to a windows folder. Later, you will upload this document as a Master Document within the Update Word Document Workflow activity.
2. Creating the Laserfiche Contract e-Form and Business Process
Next, you’ll want to add a Signature Field to your Form that you just built in the Laserfiche Forms Business Process.
a. Open Laserfiche Forms and click on the Manage tab.
b. Once in the Designer Screen, skip down to the Forms section and open the appropriate form or create a new form.
c. Insert the Signature Field.
d. Go to the Process Diagram section in the Process Designer.
e. Configure the process steps to send the Contract Metadata to Laserfiche Workflow.
1. Drag the Start Message Activity to the canvas and release it.
2. Open the details pane of the Message Start Event on the right side of the screen.
3. Set the Starting Form (there should only be one)
4. Next, drag the Workflow Service Task Activity to the canvas
5. Click on the green Message Start Event so that you see the connection arrow above it.
6. Connect the activities with an arrow from the green Start Event linked to the Workflow Task. Click and drag the arrow over to one of the Service Task’s connection points and release onto one of the points.
7. Click on the Service Task icon and open the details pane, then enter the Workflow Name. Let’s call it “Contract – MS Word”.
*Note: The workflow has yet to be built, but we will name it here in this step, and use the same name when we build the workflow.
8. Drag the End Event Activity to the canvas.
9. Connect the Service Task to the End Event.
f. Save the Process Diagram by clicking on the Save button at the top right of the screen
g. As you can see, the Business Process is very simple, with just three steps. We can now move on to the Laserfiche Workflow Designer.
h. Navigate to the Settings > Access Rights section and assign the users who will be using this form, and then go to the Settings > Process Options to publish the workflow.
3. Creating the Workflow to Generate the MS Word Contract document.
a. Launch the Laserfiche Workflow Designer windows application.
b. Name the new workflow as you named it in the Forms Service Task and connect it to the local Laserfiche Repository using the Manage Workflow Connection Profiles link.
c. Build the Workflow Activities that will fill out the MS Word Contract.
i. Drag the Retrieve Business Process Variables Activity to the workflow canvas.
ii. Set the properties on the activity to connect to the Forms server, set the Form and select the field values to Retrieve.
iii. Next, add the Update Word Document Activity
iv. Configure the properties of the activity by uploading the Contract document you just edited (the one with the replaceable text). Press the ellipsis button to select the Word file attachment.
v. Press the Add button, press the ellipsis button and select your Word file. Click OK, then press Close.
vi. Next, modify the Update Word Document activity so that it runs the Find-Replace Function that updates the values for the contract.
· In the Modifications property box on the right-hand pane, Press New…
· Using Find Replace for the company name field, enter the “Find what:” value as the replaceable text, which in our example is "1CompanyName1".
1. Check “Match case”, “Match whole word” [1] and enter the token for “Replace with:” value [2].
2. Select the %(RetrieveBusinessProcessVariables_Company) token and click OK.
In our example, we will have three Find-Replace Modifications.
vii. Add the other Find-Replace modifications by adding the other Date Replacement Fields.
viii. To add the signature, we need to create a new Simple Field Merge Modification.
1. Click New… and select Type: Simple Field Merge
2. Click on the Import field names from the document hyperlink and say Yes to the confirmation pop-up.
3. You should now see a Field name listed; allowing you enter the Value that should be inserted into the Merge Field.
4. Click OK to save the modification. You should now see four modifications in the list.
ix. To store the Contract as a signed document in the repository, you’ll use both the Create Entry Activity and the Attach Electronic Document Activity.
1. Drag the Create Entry activity onto the canvas, after/under the Update Word Document Activity.
Set the properties of the activity…
2. Then add the Attach Electronic Document Activity.
Set the properties on the activity. Choose Activity as your Source…
Set the Update Word Document>Result File as the source…
Set the Attach File To as Other Entry and select Create Entry>Output Entry…
Click OK.
d. Publish the new workflow, which will not require any conditions nor a schedule. It should Validate without errors, but if you get any warnings or errors, correct the issue and then republish.
Validation will run and then you can press No when asked if you want to create start rules. Since the Forms process starts the workflow, there is no need to give Workflow any start rules for this workflow.
You're Done!
Before:
After:
Thanks again, Kyle! Now that readers have completed all three steps, it’s now time to sign some contracts by filling out that new Form. If you have any questions or wish to speak with a CDI professional team member for assistance, contact us at support@cdi.support.
Comments