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:
- Leave pyxform as-is but document that the
appearance column only accepts static / non-dynamic values.
- Change pyxform to not process variable references in
appearance i.e. output the column value as-is.
- Change pyxform to warn or raise an error if a variable reference is found in
appearance.
- Change pyxform to warn or raise an error if any kind of expression-looking value is found in
appearance.
- 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.
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
appearancecolumn don't work in Collect or Enketo - not sure about Webforms. Workaround would be to duplicate the question with the appearance alternatives, userelevantto 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
appearancelike 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:Some options:
appearancecolumn only accepts static / non-dynamic values.appearancei.e. output the column value as-is.appearance.appearance.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
appearancevalue, or one that looks like an expression, or the client supports dynamicappearance.