Introduction
If your mobile users use the Repeat Job button often for a particular Job, you may want to set up your job different so that rather than iterating through a Job, they can select all the records they want to deal with and collect data for all those records within a single Job.
Starting in TaroWorks 4.4.x, you can pass information from many records from the last level of your drill-down hierarchy (DDH) into a repeat section of your form. This is particularly useful when you'd like to update many child records from the same parent, or create many child records, each for a different parent record. This article will walk you through the steps to set up an Attendance example using this feature. The example creates many child records (Attendance) using the repeat section, each to be associated with a different parent record (Well-site Member). Those parent records will all be selected from the last level of the DDH of the Job and each passed into their own instance of a repeat section.
The mobile user will first select what module the training is on in the first drill-down hierarchy. In the second drill-down hierarchy, they will select a Region, and well-site. Then they will select as many well-site members as they'd like to create an attendance record for. The id's for those members will each be passed into their own instance of the repeating section. The result of this Job will be a a Session record with many child Attendance records. Additionally each attendance record will be a child of a Well-site Member.
- A. Create Form with a Repeat Section - In order to pass in a variable number of records based on the mobile user's selections, we'll need to pass them into a Repeat section.
- B. Create Job with DDH allowing Multiple Record Selection - To allow multiple records to be selected we need to configure the Job so that the last level of the last DDH the mobile user will be prompted to select as many records as they wish.
- C. Create Job with all records automatically selected in the last level of DDH - To have all records on last level of DDH selected, we need to configure the job so that all records are automatically selected and the Mobile User will not be able to de-select the records.
- D. Task Map the last level of the DDH to the Repeating Section - A new instance of the repeating section will automatically be created for each record selected in the last level of the drill-down. You need to map which field values from each record you want pre-populated into the Form questions of the Repeat section.
- E. Result - The result is that many Well-site Members will be passed into the repeating section, each creating their own attendance record.
A. Create Form with a Repeat Section
- Go to the Forms tab.
- Click New Form.
- Click Save and Continue.
- Enter a Title.
- Click Save and Continue.
- In the Question Builder Tab, give your first regular section a title and click Save.
- In your Regular section, add header level questions that are not specific to each instance of the repeating section.
- Add a Repeat Section by clicking Repeat/Table from the menu on the left.
- Enter a caption for the Repeat section.
- Select Display Repeat Section as Table, so that the number of instances of the repeat section is automatically displayed as rows.
Note: Starting in TaroWorks 4.5, you can also chose non-tabular repeat sections. This can be useful for repeat sections where you want to employ skip logic. - Choose Unlimited for Set Repeat Times so that the number of times the section is repeated will be driven by how many records the mobile user selects in the drill-down hierarchy, rather than by an earlier question.
- Enter the questions that you'd like repeated for each value the mobile user selects in the drill-down hierarchy.
- On the Field Mapping tab, the objects that you map to the Repeat section will be used for each instance of the Repeat section. In this example, for each row in our table, a new Attendance record will be created for each well-site member that will be passed in from the drill-down hierarchy.
B. Create Job with DDH allowing Multiple Records Selection
- Go to the Jobs tab.
- Click New Job.
- Enter a Job Name.
- In this example, we need to drill-down hierarchies. The hierarchy that requires many records to be selected should be added last. The first hierarchy that was added was to select the module of training that is being attended. The second drill-down hierarchy is to select the Well-site Members that we want to create an attendance record for. In the DDH where you want the user to select many records, select Allow Mobile user to select multiple records in the last level.
C. Create Job with all records automatically selected in the last level of DDH
- Go to the Jobs tab.
- Click New Job.
- Enter a Job Name.
- In this example, we need to drill-down hierarchies. The hierarchy that requires many records to be selected should be added last. The first hierarchy that was added was to select the lesson that is being taught. The second drill-down hierarchy is to select the Well-site Members that we want to create an attendance record for. In the DDH where you all records to be automatically selected, select Automatically select all records in the last level.
Note:- The checkbox "Automatically select all records in the last level" will be hidden before you check the 'Allow selection of many records in the last level' checkbox.
- When the checkbox "Automatically select all records in the last level" is checked, the "Allow selection of many records in the last level" is disabled.
If you want to disable the Allow selection of many records in the last level, first uncheck "Automatically select all records in the last level" checkbox
D. Task Map the last level of the DDH to the Repeating Section
- Click New Task.
- Complete any necessary mappings that fall outside of your Repeat Section.
- For the form questions in a repeat section, you'll want to map values from the level of the DDH where you selected to Allow mobile user to select multiple records in last level. In this example, we are going to pass in the well site members' names from the records that the mobile user selects in the DDH, to serve as a reference for the parent for the attendance record we are creating with each instance of the Repeat Section.
E. Result
Comments
0 comments
Please sign in to leave a comment.