Repeating Data
There are four approaches to handle repeating data in Sync & Save:
- Create one record per repeating section row (default).
- Create one record per submission with unique names for each field in the repeating section(s).
- Combine repeating sections based on the order of entry.
- Multiply repeating sections so that all possible value combinations are produced.
For this topic, there is no difference between data from Repeating Section controls and Table controls.
This setting is controlled with the Repeats option:
One Record Per Repeat
If you select One Record Per Repeat, and you have repeating sections in your mobile form, then Sync & Save will create a new record for each entry in the repeating section. For example, if you have a mobile form that is used to enter an invoice that includes two repeating sections, one for items and one for credits, you might enter some data on your mobile device that looks like the following:
Customer: Acme Corp. | |
Invoice Date: 7/9/2012 | |
Repeat: Items | Item: Large Widget |
Quantity: 4 | |
Repeat: Items | Item: Small Widget |
Quantity: 2 | |
Repeat: Credits | Credit Item: Return Credit |
Credit Amount: 30 | |
Repeat: Credits | Credit Item: Payment Credit |
Credit Amount: 10 |
If you created the following Sync & Save export format:
- 1 {Customer}
- 2 {Invoice Date}
- 3 {Item}
- 4 {Quantity}
- 5 {Credit Item}
- 6 {Credit Amount}
The resulting data would be:
Customer | Invoice Date | Item | Quantity | Credit Item | Credit Amount |
Acme Corp. | 7/9/2012 | Large Widget | 4 | ||
Acme Corp. | 7/9/2012 | Small Widget | 2 | ||
Acme Corp. | 7/9/2012 | Return Credit | 30 | ||
Acme Corp. | 7/9/2012 | Payment Credit | 10 |
Note that you do not need to bring over fields from repeating sections more than once, unless you want them to show up in more than one column.
One Record Per Submission
If the One Record Per Submission option is selected, then Sync & Save will give each field in a repeating section a unique name by adding a number to the field name. This naming format matches the names visible on the View Data tab of the doForms portal. The Resulting fields from the above scenario would be:
- Customer
- Invoice Date
- Item(1)
- Quantity(1)
- Item(2)
- Quantity(2)
- Credit Item(1)
- Credit Amount(1)
- Credit Item(2)
- Credit Amount(2)
If you created the following Sync & Save export format:
- 1 {Customer}
- 2 {Invoice Date}
- 3 {Item(1)}
- 4 {Quantity(1)}
The resulting data would be:
Customer | Invoice Date | Item(1) | Quantity(1) |
Acme Corp. | 7/9/2012 | Large Widget | 4 |
If instead you created the following Sync & Save export format:
- 1 {Customer}
- 2 {Invoice Date}
- 3 {Item(1)}
- 4 {Quantity(1)}
- 5 {Item(2)}
- 6 {Quantity(2)}
- 7 {Credit Item(1)}
- 8 {Credit Amount(1)}
- 9 {Credit Item(2)}
- 10 {Credit Amount(2)}
The resulting data would be:
Customer | Invoice Date | Item(1) | Quantity(1) | Item(2) | Quantity(2) | Credit Item(1) | Credit Amount(1) | Credit Item(2) | Credit Amount(2) |
Acme Corp. | 7/9/2012 | Large Widget | 4 | Small Widget | 2 | Return Credit | 30 | Payment Credit | 10 |
Combine Repeats
If the Combine Repeats option is selected, Sync & Save will combine multiple repeating sections based on the order of the lines in each repeating section.
If you created the following Sync & Save export format:
- 1 {Customer}
- 2 {Invoice Date}
- 3 {Item}
- 4 {Quantity}
- 5 {Credit Item}
- 6 {Credit Amount}
The resulting data would be:
Customer | Invoice Date | Item | Quantity | Credit Item | Credit Amount |
Acme Corp. | 7/9/2012 | Large Widget | 4 | Return Credit | 30 |
Acme Corp. | 7/9/2012 | Small Widget | 2 | Payment Credit | 10 |
Note that if this option is selected when there are nested repeating sections (one repeating section inside another repeating section) only data from the first row of the nested repeating section will be exported.
Multiply Repeats
If the Multiply Repeats option is selected, Sync & Save will multiply all repeating sections together in order to produce all possible value combinations.
If you created the following Sync & Save export format:
- 1 {Customer}
- 2 {Invoice Date}
- 3 {Item}
- 4 {Quantity}
- 5 {Credit Item}
- 6 {Credit Amount}
The resulting data would be:
Customer | Invoice Date | Item | Quantity | Credit Item | Credit Amount |
Acme Corp. | 7/9/2012 | Large Widget | 4 | Return Credit | 30 |
Acme Corp. | 7/9/2012 | Large Widget | 4 | Payment Credit | 10 |
Acme Corp. | 7/9/2012 | Small Widget | 2 | Return Credit | 30 |
Acme Corp. | 7/9/2012 | Small Widget | 2 | Payment Credit | 10 |