Skip to content

Commit

Permalink
OHRI-2069 repeatable obs group docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arodidev committed Jan 10, 2024
1 parent a2053b5 commit 36ded99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pages/docs/field-types-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ Renders a repeating group field.
"type":"obsGroup",
"questionOptions":{
"rendering":"repeating",
"concept":"8acba1d1-67cc-422c-961e-86d6b47bc45b"
"concept":"8acba1d1-67cc-422c-961e-86d6b47bc45b",
"repeatOptions": {
"limitExpression": "useFieldValue('groups_count')"
},
},
"id":"testObsGroup",
"questions":[
Expand Down Expand Up @@ -473,3 +476,15 @@ Renders a repeating group field.
Renders:

![Repeating field](/repeating.png)

The required number of repeatable groups is inferred from the value obtained from the `limitExpression` property in the `repeatOptions` object.

```jsx copy
"repeatOptions": {
"limitExpression": "useFieldValue('groups_count')"
}
```

If the number of repeated groups in the form does not match the required number specified for the field, a validation error will be thrown.

![obsCountError](/obs-count-error.png)
Binary file added public/obs-count-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 36ded99

Please sign in to comment.