Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choice Filter choices representation in XForm json['children'] field #234

Closed
lincmba opened this issue Nov 7, 2018 · 0 comments · Fixed by #235
Closed

Choice Filter choices representation in XForm json['children'] field #234

lincmba opened this issue Nov 7, 2018 · 0 comments · Fixed by #235

Comments

@lincmba
Copy link
Contributor

lincmba commented Nov 7, 2018

Using this form with label choices for questions with choice filter, the resulting saved Xform json['children'] field contains

[
  {
    "children": [
      {
        "name": "texas",
        "label": "Texas"
      },
      {
        "name": "wdc",
        "label": "WDC"
      }
    ],
    "name": "state",
    "label": "state",
    "type": "select one"
  },
  {
    "itemset": "counties",
    "name": "county",
    "choice_filter": "${state}=cf",
    "label": "county",
    "type": "select one"
  },
  {
    "itemset": "cities",
    "name": "city",
    "choice_filter": "${county}=cf",
    "label": "city",
    "type": "select one"
  },
  {
    "control": {
      "bodyless": true
    },
    "children": [
      {
        "name": "instanceID",
        "bind": {
          "readonly": "true()",
          "calculate": "concat('uuid:', uuid())"
        },
        "type": "calculate"
      }
    ],
    "name": "meta",
    "type": "group"
  }
]```

The choices with choice filter do not explicitly appear here as children. This affects further processing as in exporting with labels. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant