cds-snc / cds-snc/platform-forms-client
Client confusion about repeating set question IDs
- Dominant language
- TypeScript
- Stars
- 46
- Forks
- 16
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 85
Description
## Description
https://cds-snc.freshdesk.com/a/tickets/28729
> We are struggling with parsing API retrieved GCForm Answers.json for the GCForm repeating sets/blocks. The retrieved Answers are correct in Arrays however “id’ are messed up.
https://cds-snc.freshdesk.com/a/tickets/29119
> When retrieving submissions from the API for dynamic row (i.e. repeating set) questions, there is no way to accurately calculate or view the internal ID's for sub elements. For example, a dynamic row question with id 48, the sub elements should follow 4801 (internal id = 0), 4802 (internal id = 1), 4803 (internal id = 2), etc. However, in this case the first sub element was 4805 (internal id = 0), which makes it impossible to map these values programmatically. Currently, we are forced to manually add these internal values into a config file by retrieving an actual submission and searching through it.
---
Due to some architectural limitations in how we store repeating sets, the IDs we use to identify the Questions and the numbers that index the Responses do not correspond.
It's best to ignore the Question IDs and think of each side of the mapping as zero-indexed arrays.
Contributor guide
Research direction
Start by reviewing the linked Freshdesk tickets and the Answers.json examples to understand how repeating-set Questions and Responses are represented. Confirm whether the intended outcome is API documentation or a change to the returned IDs; done should make the zero-indexed mapping and its limitations unambiguous for API consumers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100