Looking for ideas on how we can utilize forms for one of our HR processes. Currently we use DocuSign and do a bulk csv send for HR document such as Personnel Policy Manual acceptance changes. But it is very time consuming to get those all into our repository with meaningful data so workflow can route them. I wanted to look into the possibility of using forms to accomplish this but am unsure of how to best accomplish this. I was thinking start with a forms session that calls to a workflow to query the data from a database of all users but then wondered if there was something all within forms that allows me to do a mass assignment to each individual employee. We utilize workflow quite a bit but I will say I have not used it yet in combination with forms so gathering that data and passing back to forms to assign the task I might need some direction if that is the way to go. We currently use windows users and not LF users. Thanks!
Question
Question
Answer
This is very doable utilizing Forms in conjunction with Workflow. I have several recurring processes like this that kick off a form to dozens of employees on a scheduled basis that works like this.
In Forms:
A. Your form will need a field (it can be hidden) to hold the employee's user name.
In workflow:
1. Use a query task (either Query Data or Custom Query) to get your user data from a database. This could be your windows user database, a custom database of your users, or the cf_users table in your LFForms database.
2. Follow this by a For Each Row task to cycle through all of the results from the query.
3. Within the For Each Row cycle, add a Invoke Business Process task to kick off your forms process. Into the Form variable you created in Step A, you'll populate the user name token from the for each activity.
It'll look something like this:
In Forms:
B. The process model for your form will need to start with a basic start event (not Message, Timer, or Error).
C. Following the start event, your form should lead into a User Task. The user task should be assigned to the user name field in your form that was set-up in step A.
It'll look something like this:
You can do a lot of things to customize your process to make it reusable. For example, you can have your "instructions" placed in a multi-line field (if you want, you can tweak the CSS to make it not look like a form field) - then populate the contents of that multi-line field from your Workflow (the same way you populate the user name). Additionally, you can easily run your workflow on a schedule, or one-off manually.
You can easily create and assign out dozens or even hundreds of forms in this manner.
Thank you so much for your help on this. I have a lot of these component already but could not figure out how to pass the user back from workflow I will add that field to my form and see how I turn out.
Thanks!!
Excellent! Thanks Matthew for the help. I wish forms had a default variable for the user assignment that was visible to workflow but this is a very good solution.
So this worked! I am struggling trying to pass multiple variable back to my form? Right now I did my starting variable as my user and it works. Also on my form I have Employee First Name and Employee Last Name and those same fields exist on my spreadsheet that I am using to query my data from and would like to prefill those fields. Can I do that?
Thanks
Yes, passing multiple variables from your workflow into your form is possible. It's not too hard if they are basic form fields. If they are fields in a table or collection it's a little trickier (still very possible, just a little more complex).
In the "Invoke Business Process" task in your workflow, in the "Fields" section, select as many of your form fields as you want. Then in the "Starting Variable Values" section, you can populate values into those fields. Syntax of values in the "Starting Variable Values" section is always form_process_variable_name=%(workflow_token_name) - but don't try to type them out, just make good use of the variable picker (the > button).
If you are wanting to populate a table or collection, then you'll need to make use of multi-value tokens in Workflow. Then the table/collection fields are populated by that multi-value token. Syntax looks like this: form_table_name.variable_name=%(multi_value_token_name). Again, make good use of the variable picker.
Here's a screenshot from one of my workflows that kick off a dozen or more forms every day. You can't see the whole thing, but what I want to show is the multiple form fields being populated by the workflow. This particular workflow runs each morning and queries our account database for new loan account records created the day before. Then within that query's "For Each Row" it does another query against a different database looking up user data about the employee who created the loan record. Then another query against the first database returns collateral records from the loan record (loans and collateral have a one-to-many relationship, so it couldn't be included in the first query). This query is followed by another "For Each Row" activity which includes an activity to create multi-value tokens to contain the collateral records. Finally, the form is kicked off (and assigned to the loan officer). Fields in the form are populated with results from the first query's "For Each Row" activity, the second query's results, and the multi-value token created with the results of the third query. This is all pretty complex to explain here, but what I wanted to demonstrate is how versatile you can make your process by using Workflow to kick off your form. You can pull data from multiple sources, complete calculations on that data, manipulate that data, pull information in from your repository, etc., etc., etc. and then use all of that to kickoff a form. Or call Worflow from within your Forms process to run some calculations, passing all sorts of data from Form to Workflow and back again. It's all pretty unlimited.
Great! This worked. I realize I need to pay more attention to the variable that forms creates since on this I had edited my form field after original creation and forgot that my variable was different. I really appreciate your help on this Matthew.
If needed, you can rename variables in Forms (from the Variables tab in the Layout Page in Forms - click the little gear icon next to your variable). Bear in mind that your workflows will NOT be automatically updated if you do that.
Please consider marking the question as answered if we addressed everything you needed
Matthew would you know why each time I run this I get more an more instances kicking off even though I don't have that many rows in my database? I can see my workflow is viewing that many rows in my query data activity but I don't know why. My criteria says return all rows but if they don't contain data why would it think there is data present? I have went to my excel sheet and deleted blank rows just to see if that helps and still nothing.
Thanks
I've had problems with duplicates and extra records, all based on the way my query was written. I had joined in a couple tables that I *thought* all had a one-to-one relationship, but occasionally had a one-to-many relationship, so I was getting more results in the query results than I had expected.
That would be my first guess regarding the issue you report. Anything more specific is difficult without seeing more of what you have set-up.
Thank you.