Skip to content

Clarify / revise what happens when a question appearance is dynamic #788

@lindsay-stevens

Description

@lindsay-stevens

Thought of this while working on #714 and specifically in thinking about which columns actually need to be inspected for variable reference tokens. Since #724 (v2.2.0 Oct 2024) practically the whole workbook is being inspected which is probably too much. In a more practical sense it also seems to be a point of confusion on the forum:

According to the above threads, dynamic values in the appearance column don't work in Collect or Enketo - not sure about Webforms. Workaround would be to duplicate the question with the appearance alternatives, use relevant to swap between them, (and presumably) fold the values from them into one column at some point for analysis (this probably would complicate form expressions using that question as well).

Currently pyxform treats appearance like most other columns - validate and resolve any variable references to a XPath, and output the value. As of pyxform 4.1.0 that would look like:

| survey |
| | type   | name | label | appearance |
| | text   | q1   | Q1    |            |
| | text   | q2   | Q2    | ${q1}      |
<input appearance=" /test_name/q1 " ref="/test_name/q2">

Some options:

  1. Leave pyxform as-is but document that the appearance column only accepts static / non-dynamic values.
  2. Change pyxform to not process variable references in appearance i.e. output the column value as-is.
  3. Change pyxform to warn or raise an error if a variable reference is found in appearance.
  4. Change pyxform to warn or raise an error if any kind of expression-looking value is found in appearance.
  5. Change pyxform to warn or raise an error if any values besides the supported options are found in appearance.

Not sure how common it is, but some alternative form clients might have custom appearances that could be a false-positives problem for options 2 through 5 - i.e. a custom appearance value, or one that looks like an expression, or the client supports dynamic appearance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions