Tech Tip: Dynamically Generate Laserfiche Forms URLs
By: Eric Cressey
Technical Writer
Pre-populating form fields ensures that information is entered according to your company’s best practices, and it can make it much easier to fill out a form. In a previous tech tip, I described how to use URL parameters to pre-populate a form’s fields so that, when a user opens the form, those fields will already be filled in. In this tech tip, I’ll build on that information and describe how to use Laserfiche Workflow to dynamically generate Laserfiche Forms URLs with parameters.
Rather than manually appending URL parameters to Forms URLs, you can use Workflow to create Forms URLs with tokens as parameters. Consider the following example:

In this example, the Find User activity finds the user who should fill out a form. Then, the Assign Token Values activity creates a token called Forms URL using the base URL of the form followed by the URL parameter syntax for the Name and Email fields on the form — these values are filled by tokens from the Find User activity.

The Email activity sends an email to the user from the Find User activity, and includes the Forms URL token in the body of the message.

When the user opens the email and clicks the link, the form opens with the specified fields already filled in.

Note: You can also pre-fill fields that are used in lookup and page rules, but you’ll need to include the following JavaScript on the Script page of the Form Designer to make the rules run when the user opens the form:
$(document).ready(function () {
$(‘#Field4‘).trigger(‘change’);
})
Replace Field4 with the appropriate field’s input box ID attribute. If the matched field’s id attribute is q4, its input box’s ID attribute will be Field4.
Using this method, you can email form links directly to users who need to fill out certain forms and have specific fields pre-populated, ensuring consistency throughout your business process.