Skip to content

Commit ed0e7bc

Browse files
authored
Merge pull request #1072 from david-roper/add-csv-doc-example
Add csv doc example
2 parents 0a0a1a3 + fcb45fe commit ed0e7bc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/en/3-guides/3.3-how-to-upload-data.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,37 @@ Open Data Capture allows you to visualize numeric measures over time in a single
6868
Whenever data is optional within a form it can be left empty and still be properly submitted. Any optional data column in the csv template will have an "(optional)" tag attached to its sample data entry, which means any entry in the column can be left blank. This is usually done in that case of when one column value depends on another. For example, a sessionFailed column would be followed by an optional reasonForFailure column.
6969

7070
</Steps>
71+
72+
### Sample CSV Data
73+
74+
This section will present how to properly fill in a template csv from the upload feature. Say we download the following csv template that looks like this below:
75+
76+
| subjectID | date | stringQuestion | setQuestion | optionalQuestion | recordArrayQuestion |
77+
| :-------- | :--------- | :------------- | :-------------- | :--------------- | :--------------------------------------------------- |
78+
| string | yyyy-mm-dd | yes/no | SET(A/B/C, ...) | A/B (optional) | RECORD_ARRAY(testString: A/B/C, testNumber: number;) |
79+
| | | | | | |
80+
81+
<br>
82+
83+
Starting with the first column we have **subjectID**, which is a string value containing the identification of the subject taking part in the instrument. This field is required.
84+
85+
The second column contains the date of which in instrument was done by the subject, which follows _yyyy-mm-dd_ format. This field is to be filled for each row.
86+
87+
The third column is a string entry consisting of two possible options (yes/no).
88+
89+
The fourth column is a field which takes in a set of entries, where the options are A, B or C. The set can have all these option within it, however it does not accept duplicates. So an entry such as `SET(A,A,C)` would fail, but the entry `SET(A,B,C)` would be valid.
90+
91+
The fifth column is an optional string field with the possible options of A or B. This field can hold either A, B, or can remain empty.
92+
93+
Finally, the sixth column is a record array field. This record array object can have the fields testString and testNumber entered within it. These internal field values are entered by including the fieldname and its corresponding value separated by a **":"**. In addition, a record array can also have multiple entries for each internal field within it as long as the new entry is separated by a **";"**. With that in mind, valid entries for this column would be `RECORD_ARRAY(testString: A, testNumber: 1;)` or <br>
94+
`RECORD_ARRAY(testString: A, testNumber: 1; testString: 1, testNumber: 2;)`, etc.
95+
96+
<br>
97+
98+
A valid CSV file that follows this template can be seen below:
99+
100+
| subjectID | date | stringQuestion | setQuestion | optionalQuestion | recordArrayQuestion |
101+
| :-------- | :--------- | :------------- | :----------- | :--------------- | :-------------------------------------------------------------------------- |
102+
| testID123 | 2025-01-07 | yes | SET(A, B, C) | B | RECORD_ARRAY(testString: A, testNumber: 2; testString: B, testNumber: 3;) |
103+
| testID111 | 2025-01-06 | no | SET(C, B) | A | RECORD_ARRAY(testString: B, testNumber: 22; testString: A, testNumber: 1;) |
104+
| testID111 | 2025-01-03 | no | SET(A, C) | | RECORD_ARRAY(testString: B, testNumber: 12; testString: B, testNumber: 13;) |

0 commit comments

Comments
 (0)