Skip to content

The sub-elements appear differently in the form’s JSON template compared to the JSON response. #6487

@mo-cds

Description

@mo-cds

Ticket: https://cds-snc.freshdesk.com/a/tickets/25893

I’m trying to link the properties in the template to the appropriate data in a response JSON.
For most fields, I can use the “id”, which is used in both the template and the answers, but for subElements of repeatable elements that connection breaks down.
For example, this is the parent element plus two subElements in my template:

{"id": 78, "type": "dynamicRow”,…. "properties": {"tags": [], …, "subElements": [
{"id": 7801, "type": "textField", …, "properties": { …, "questionId": "6_Establishment", …}},
{"id": 7802, "type": "textField", …, "properties": {…, "questionId": "6_DEL", …}}

In the downloaded answers, the responses to those particular questions are represented like this:

"78":[
{"0":"fab 1 estab","1":"fab 1 del + site"},
{"0":"fab 2 estab","1":"fab 2 del ltr"}
],

Ideally, it would look like this to make it easier to link the response to the appropriate questionID (unless I’m missing something):

"78":[
{"7801":"fab 1 estab","7802":"fab 1 del + site"},
{"7801":"fab 2 estab","7802":"fab 2 del ltr"}
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions