/
DynaForm Controls

DynaForm Controls

Search the IFS Workflow Wiki
 

Back to IFS Workflow Home  

Find out about strategies for using Process Maker's DynaForm controls with IFS Workflow.

Dropdown Controls

Dropdown Controls





Dropdowns are built by creating an array of elements, with each element being an array of a string <value> and string <name> value.

  1. In IFS Workflow, select the Designer tab.

  2. In the Designer screen, select a workflow, and then click Edit.

  3. In the workflow, select a task with a DynaForm where you want to create a dropdown.

  4. In the Blue Process Objects dialog box, select DynaForms

  5. On the Dynaforms screen, find the form where you want to add a dropdown control, and then click Edit.

  6. In the Web Controls dialog box, click on dropdown ( ) and drag it onto the form.

  7. On the Create/Select Variable screen, enter a name and then click Save.

  8. On the DynaForm edit screen, in the Properties dialog box, set the variable property to the <value> of the selected element and identify what will be passed through to further steps within the process.

  9. The datasource property should be set to array variable when populating the data variable property from a REST service call within a trigger (see the example below).

Example PHP Trigger

$localArray = array(); //**Build a local array with elements**//
if ($httpResponse == 200) {
$contents = utf8_encode($restResponse);
$jsonArray = json_decode($contents, true);
$i=1; //**Array must start at 1, not 0 to ensure the first element is shown**//
$fields = $jsonArray["_embedded"]["fields"];
foreach ($fields as $field) {
$localArray [$i] = array($field['id'], $field['id']." - ".$field['longName']);
$i++;
}
}
@@dropdownArray = $localArray; //**Populate the array variable that will be used on the dynaform once the localArray has been fully built**//

Adding Blank Rows

If you need a blank row in the dropdown, you can add the following line of code within the trigger:
 
//Add blank row
$marketingRepsArray[1] = array("", "");
$i = 2;
 
When doing this, ensure you start $i at 2 so as to not write over the blank line.

Dependent Dropdowns

In some cases, you may want to have dependent dropdowns. This allows a user to select an element in dropdown A, which changes the options available in dropdown B. 

This is only possible through use of Process Maker tables and therefore is not recommended.  For more information see the Process Maker wiki on SQL Stored Procedures and Dependent Fields.





Grid Controls

Grid Controls



A grid is a graphic design that presents data in a tabular format consisting of columns and rows. Grids are built by creating an array of elements, with each element being an array of PM Controls. 

Controls that can be used are:

Populating the Grid

When adding a control to a grid, you will to give it an ID like you would any other variable.  Within the main Grid Array, each element will be another array, of which this ID will reference the key value of the PM Control that has been added.

  1. In IFS Workflow, select the Designer tab.

  2. In the Designer screen, select a workflow, and then click Edit.

  3. In the workflow, select a task with a DynaForm where you want to create a grid.

  4. In the Blue Process Objects dialog box, select DynaForms

  5. On the Dynaforms screen, find the form where you want to add a dropdown control, and then click Edit.

  6. In the Web Controls dialog box, click on grid ( ) and drag it onto the form.

  7. On the Create/Select Variable screen, enter a name and then click Save.

  8. On the DynaForm edit screen, in the Properties dialog box, set the variable property to the <value> of the selected element and identify what will be passed through to further steps within the process.

  9. The datasource property should be set to array variable when populating the data variable property from a REST service call within a trigger (see the example below).

The following code is an exampe of how you could populate the grid shown below:
// @=departmentArray is a global array variable that will be set within the Dropdown Control Properties panel in PM and will be used in every row
@=departmentArray = array (
1=> array('1','IT'),
2=> array('1','HR')
);
// @@userGrid is a global grid variable - userName and active refer to the ID's for the textbox and checkbox control within the grid
@@userGrid[1] = array(
'userName' => "andy",
'active' => 1                                               
);
@@userGrid[2] = array(
'userName' => "Jeff",
'active' => 0
);

Accessing Grid Data

To get access to the grids data, you need to reference the grid and row of data that you require, and then the controls ID.  So to get the data from row 2 in the above example, you could use the following:

$selectedData = @=userGrid[2][userName]." ". @=userGrid[2][department]." ". @=userGrid[2][active];

More information can be found on the Process Maker Wiki Page.

Uploading Files vs. FileUpload

Uploading Files vs. FileUpload

In essence, uploading files (file control) and FileUpload is the same thing except FileUpload allows you to upload multiple files at once. 

When adding these controls to a Dynaform, they both need an associated Input Document. However, they differ as to when this association is made.

  • File control. You must add the association when you first add it to the Dynaform.

 

  • FileUpload. You add the association once it's been added to the Dynaform, in the properties of the control.





Input Document Usage

There are two places where you can use a control to upload files:

  • A DynaForm

  • A step in a task

The element is called inputDocument (Input Document)

In a workflow, you can use a single input document through the workflow, even in different dynaforms.  However, each time it is used it will add a new document to the process.  Even if they are given the same name, they will be distinguished by the task they were added by. In other words, there is no version control, as is shown in the following figure.

 

This does, however, allow for all documents added during a process to be viewed once the process has completed.

When adding a document as a Step, you will be taken to a screen similar to the following:

This allows you to add a new version of the file to the process as well as viewing all previous versions of the file. 

Once the process is completed, you will only be able to view the last version of the file.


Copyright© 2024 IFS AB. Copying prohibited. All rights reserved.