Versions Compared

Key

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

Rules are probably best described by using examples. This chapter contains numerous real world samples.

...

Show/Hide Manager Approval

You have a flow and the first form has a Section for manager approval. The Section is hidden by default. Here is an example of a rule that makes the section visible in the second step of the flow which is a linked activity assigned to the manager role. 

Code Block
if (form.load) {
  var an = _data.getParameter ("flow.activity.name");
  if (an === 'Manager' || an === 'VP'){
    ManagerApproval.visible = true;
  } else {
    ManagerApproval.visible = false;
  }
}

...

A rule can dynamically display an image uploaded to your form via the upload control. In this example the upload control is named 'u'. The form also must contain a message control as a place holder for displaying the uploaded image. The rule dynamically creates a URL to the uploaded image in the temporary attachment repository. The upload control's value 'u.value' is a GUID that uniquely identifies the attachment. The uploaded image is included in the submissions pdf.

Code Block
languagejavascript
if (u.value.length > 0) {
  var baseUrl = _data.getParameter('_frevvo_base_url') + 
      "/frevvo/web/tn/" +
      _data.getParameter('tn.id') +
      "/user/"+_data.getParameter('user.id') +
      "/app/"+_data.getParameter('app.id') +
      "/form/"+_data.getParameter('form.id');
 
  im.value = "'<img src="'" +
         baseUrl + "'/attachment/"' + u.value+"'/does_not_matter'"/>"';
} 

Here is the example form before and after the user has uploaded the orangegrove.png image:

...