Live Forms Latest - This documentation is for Live Forms 8.1. v8.1 is a Cloud Only release. Not for you? Earlier documentation is available too.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
hiddentrue

Kick Off Workflow Tasks from a Form

It is possible to "kick off" workflow tasks for more than one user from a form. The HR or Finance person fills in the form and selects a user(s) to send the task to. A task for the workflow will appear on the Task List of the selected users.

Let's take a look at a simple example first. You want to create a form that launches an Employee Review workflow task and adds them to the employee manager's Task List. The form is executed by an HR employee when Employee Review time comes around.

This example form contains the following:

  1. A field for the URL to the workflow that you are calling. Copy the Raw Link URL from the workflow and add it to that field
    1. Cloud customers must change http://app.frevvo.com to frevvo:// in the URL to the workflow.
    2. In-house customers must change the http:<domain>:<port> to  frevvo:// in the URL to the flow.
  2. A field for the HR employee to enter the user id of the employees manager. The workflow task is added to this user's Task List
  3. A business rule which uses the http.get method to call your workflow URL. The rule shown below runs when the user clicks the Submit button and builds the URL to the workflow by taking the value of the flow URL from the field and adds an _data parameter to copy data (Manager Id, First Name /Last Name) from the form to the flow task.

    Code Block
    titleThis rule builds the URL to the workflow and copies the Manager's Id, First and Last Name from the form
    var user = managerid.value;
    var fn = FirstName.value;
    var ln = LastName.value;
    if (form.unload) {
      url = FlowToLaunchURL.value + "&_data=(managerid:" + user + ",FirstName:" + fn + ",LastName:" + ln + ")";
      http.get(url);
    }

 It allows you to trigger the flow for a different user or role when you browse the flow URL. In your case, I would recommend that you create a separate form with all the basic information fields in it. Then add a field where the user filling in that form can add the list of users for whom he wants to start the flow. Then create a business rule which uses http.get method to call your workflow URL. You will have to call this URL multiple times depending on how many users you want to create the task for. And you can pass the usernames of those users and basic information data to the flow in this URL by using  _data URL parameter .

Field Budget Workflow

Start a new workflow from another form or flow

It is possible to "kick off" workflow tasks for more than one user from a form. The HR or Finance person fills in the form and selects a user(s) to send the task to. A task for the workflow will appear on the Task List of the selected users.

Let's take a look at a simple example first. You want to create a form that launches an Employee Review workflow task and adds it to the employee manager's Task List. The form is executed by an HR employee when Employee Review time comes around. We will build an Employee Review Workflow and  Employee Review Launch Form  to see how this works.

Expand
  1. Build the Employee Review Workflow first. This is the workflow that is launched by the Employee Review Launch Form. Follow these steps:
    1. Create a new flow and name it Employee Review workflow. If you want to know more about creating flows refer to Flow Tutorial.
    2. Drag and drop 4 text fields from the palette.
    3. Name them EmployeeID, ManagerID, FirstName, LastName respectively in the properties panel of each text control.
    4. You can add any additional fields you want but that is optional. Click on the Image Added icon. It will bring you to the flow steps.
    5. Click the first step and click the settings icon Image Added on that step.
    6. It will open the settings wizard.
    7. In the Assignment tab enter {ManagerID} in the Assign to User field.
    8. Click Submit to save and close the wizard.
    9. In the flows property panel on the left check the Task for First Step checkbox.
    10. Click on the save icon to exit the flow
  1. Follow these steps to build the Employee Review Launch Form. This form will start multiple new Employee Review workflows.
    1. You cannot launch a flow sent to the currently logged in user’s task list. You can only send it to another user’s task list. Make sure you are not logged into the other user’s frevvo account when running the Employee Review Launch form. This is being improved in a future release.
    2. Create a form named Employee Review Launch Form. To know more about creating form refer to Forms Tutorial.
    3. In the form drag and drop a text control from the palette. 
    4. In the control’s properties on the left, name the control FlowToLaunchURL. You can enter any label you like.
    5. Uncheck the visible checkbox in the control’s properties to make the control hidden. 
    6. Save the form.
  2. Copy the Share Dialog Raw Link URL for the Employee Review workflow (the flow you want to launch for each employee) into that field. To do this:
    1. Go to the Flows tab.
    2. Click the Image Addedlink under the Employee Review Workflow 
    3. This will open a Share flow wizard . Click on the Raw flow link. Copy the URL in the left textarea. NOTE: any other share URL type will not work.
      Image Added
    4. Paste the copied URL in the Employee Review Launch Form FlowToLaunchURL field
    5. Make the following changes to the URL pasted in the field,
      1. Cloud customers must change http://app.frevvo.com/443/ to frevvo:// in the URL to the workflow.
      2. In-house customers must change the http:<domain>:<port> to  frevvo:// in the URL to the flow.
  3. Add an EmployeeID dropdown field. The HR manager will select the employees to be reviewed from this dropdown. You can either add the userID in the Options field in the properties panel of the dropdown control or fetch all the users from the tenant through business rule as below:

    Code Block
    var event = form.load;
    var Users = [];
    Users = frevvo.userIds();
    EmployeeID.options = Users;
  4. Add a ManagerUserID dropdown field. The HR manager selects the manager responsible for reviewing this employee. This is the task list you want the Employee Review form to be sent to. The ManagerIDs can be added through the Options property of the dropdown or fetched from the tenant through  Business rules as below:

    Code Block
    var event = form.load;
    var Managers = [];
    Managers = frevvo.userIds(“<Your Manager Role>");
    Manager.options = Managers;
  5. Add text controls named FirstName & LastName for the HR manager to enter the employee’s name or they can be fetched through Visual rule builder:

    1. Click on the + icon for Create New Rule

    2. Navigate to the new rule created and click on theImage Addedto open the rule window.

    3. Click on the Run Builder Button to open the wizard

    4. On the first step enter condition EmployeeID in the first dropdown and select Is filled in the second dropdown

    5. Click Next, Select FirstName in first Dropdown, ‘to’  in the second dropdown and userFirstName() function in the third.

    6. Click Add Action in the right hand top corner.

    7. In new added line Select LastName in first Dropdown, ‘to’  in the second dropdown and userLastName() function in the third.

    8. Click Next. Add 2 Actions and set the FirstName and LastName to ‘to empty’ in the second dropdown.

    9. Click Finish. This rule will automatically populate the FirstName and LastName for the selected EmployeeID.

  6. Add a trigger control named Launch to the form. When the trigger is clicked the form will launch a new Employee Review workflow and put the first step task on the selected Manager’s Task List.

  7. Add a business rule to call your Employee Review Workflow via the http.get method. The rule shown below runs when the user clicks a Launch trigger button. The rule appends frevvo _data URL parameters to initialize each Employee Review workflow. The rule allows you to trigger the flow for a different user or role when you browse the flow URL.

    Code Block
    if (Launch.clicked){
       var myurl = FlowToLaunchURL.value;
       http.get(myurl + "&_data=(EmployeeID:{EmployeeID},ManagerID:{ManagerUserId},FirstName:{FirstName},LastName:{LastName})");
    }
  8. To test:

    1. Open the Employee Review Launch Form. Select a user from the Employee ID dropdown. The First and Last Name fields are populated with the selected user's information. Select a Manager from the Manager ID dropdown. Click the trigger to run the rule.
    2. Log out. Log back in with the Manager ID you selected. Verify that an Employee Review workflow task is on the Manager's Task List.

In a real case scenario, it is recommended that you:

    1. Create a separate form with all the basic information fields in it. Then add a field where the user filling in that form can add the list of users for whom he wants to start the flow. 

    2. Create a business rule which uses http.get method to call your workflow URL. You will have to call this URL multiple times depending on how many users you want to create the task for. You can pass the usernames of those users and basic information data to the flow in this URL by using  _data URL parameter. 

Rejecting a step: sending it back to the original user

...