Data Collection is a setting that can be turned on or off on Data Objects. Turning the setting on will transform a Data Object into a Data Collection and add the small icon of three vertical lines on the Data Object symbol indicating that the Data Object is a Collection.
A Collection can be seen as a container or virtual folder. It can contain zero to many forms as a collection. It is possible to create the same form multiple times and it is possible to configure and "handle" all those forms in bulk through the Collection.
Configure Data Collections
Create a Data Collection
On any Data Object it is possible to turn on the collection setting. This will turn the data object into a collection and make it possible to contain multiple data objects or forms. In order to be able to take advantage of the feature you need to configure the Data Object in the correct way along with the rest of the application. See Patterns and Uses below for examples of how to use Data Collections.
Add a data collection to a task
End users can create forms in a Data Collection if you configure the process to have the Data Collection as an output from a task. It will be possible for the end user to create and fill in the Form several times. Each time the saved form will show up in the Content Folder and Task Panel. This configuration will requires that at least one form is created. The user will not be able to complete the task before this is done.
Note: Data collections will not work within script components.
Make a Data Collection optional to create
If a Data Collection is configured to be "optional" then it will be up to the end user to decide whether or not one or more forms should be filled in or not. This setting can be used to steer whether or not the app expects at least one form. The setting is made on the Association link, the line between the Collection and the Task.
Patterns and uses
1. Create multiple forms of the same kind in collection
You can configure a process app to accept multiple forms of the same kind in a collection. This can be useful in cases where you want to register findings and deviations when performing a visual inspection or round where each finding should be filled in and described separately.
The example above shows the process for a safety inspection. The app is started by the inspector who describes what to inspect, when it is initiated, and other important information in the form called Inspection. If a finding is made while performing the inspection, the user can document the finding and add it to the collection. This is done for every finding that is made and then the task Perform inspection is completed. If no finding is made, then the task can be completed without creating a finding since the association is set to Optional. In the task Follow-up inspection the inspector finalizes the information and reinspects the equipment before ending the inspection.
2. Handle multiple forms as separate sub instances
In some cases, it is not enough to just create multiple forms and to have them in a collection, you want to be able to handle each individual form and make people perform tasks on it. This can be done by sending each form in the collection to a sub process and to configure the app to continue to do work there.
- In the above example, in the task Perform inspection, the user clicks on the available task action Create finding that will allow them to fill in the form Findings that is placed in the Collection. When the user clicks Save, it is then sent to the Sub Process called Mitigate finding where the finding is mitigated in some way. The user does this for each finding which creates a sub instance for every finding ensuring that they are all handled correctly and not forgotten. Only when every finding has been mitigated the entire Inspection is completed.
- In order for the process app to know which finding from the Finding Collection should be sent into the Sub Process called Mitigate finding, you must configure the association link to Select the Latest Form, as seen below. Only then will the finding that was just created be sent into the sub process.
- The sub process Mitigate finding must be configured as below in order to receive the latest filled in finding from the collection and to use it in the following tasks as any normal form. When configuring the subprocess, you must create an unknown data object. This data object must have a different name than the data collection and be connected to the start object in the sub process. This will allow the sub process to rely on the input being sent in from the outside of the process and only receive the latest created form.
Note: It is important that the collection called Findings and the Data Object called Finding are two separate objects with two different Data IDs. Best practice is to name your collection in plural since it is a collection of multiple items. When the user chooses to create a finding, they will see the name of the Form Template when creating a new item in the collection, not the name of the collection.