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 toggle the "collection" setting. This will turn the data object into a collection and make it possible to contain multiple data objects or forms. There really isn't more to it than that. However, 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 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. For the End User it will be possible to create and fill in "Form" several times. Each time the saved Form will show up in the Content Folder and Task Panel. This configuration will however require that at least 1 Form is created. The user will not be able to complete the task before this is done.
Make a Data Collection optional to create
If a Data Collection is configured to be "optional" the it will be up to the end user to decide whether or not 1 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 or not. 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 those cases that 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 app is started by the inspector who describes what to inspect, when it is initiated and some other information in the form called Inspection. While performing the inspection and if a finding is made the user can document the finding and add it to the collection. This is done for every finding that is made and the task Perform inspection is then 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 user finalizes and information and does some more work 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 in there.
- In the above example, in the task Perform inspection, the user clicks on the available task action Create finding that will allow him/her to fill in the form Finding 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 that only one single finding from the Finding Collection should be sent into the Sub Process called Mitigate finding, you must configure the association link to Select Single 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 a single finding from the collection and to use it in the following tasks as any normal form.
NOTE! It is important that the collection called Findings and the Data Object called Finding are 2 separate objects with 2 different Data Ids. A good 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, (s)he will see the name of the Form Template when creating a new item in the collection, not the name of the collection.