Appearance
The appearance column in rtSurvey allows you to customize the visual presentation and behavior of questions in your surveys. This feature enhances user experience and can significantly improve data collection efficiency. rtSurvey supports standard XLSForm appearance attributes and extends them with additional options.
Standard XLSForm Appearance Attributes
rtSurvey supports the following standard XLSForm appearance attributes:
| Appearance Attribute | Question Types | Description |
|---|---|---|
| multiline | text | Creates a multi-line text box (best for web clients) |
| minimal | select_one, select_multiple | Displays choices in a dropdown menu |
| quick | select_one | Auto-advances to next question after selection (mobile only) |
| no-calendar | date | Suppresses the calendar display (mobile only) |
| month-year | date | Allows selection of month and year only |
| year | date | Allows selection of year only |
| horizontal-compact | select_one, select_multiple | Displays choices horizontally (web only) |
| horizontal | select_one, select_multiple | Displays choices horizontally in columns (web only) |
| likert | select_one | Presents choices as a Likert scale |
| compact | select_one, select_multiple | Displays choices side by side with minimal padding |
| quickcompact | select_one | Combines compact display with auto-advance (mobile only) |
| field-list | groups | Displays entire group on one screen (mobile only) |
| label | select_one, select_multiple | Shows choice labels without inputs |
| list-nolabel | select_one, select_multiple | Shows inputs without labels (use with label) |
| table-list | groups | Displays questions in a table format |
| signature | image | Enables signature capture (mobile only) |
| draw | image | Allows freehand drawing (mobile only) |
| map, quick map | select_one, select_one_from_file | Enables selection from map features |
Best Practices for Using Appearance
- Consistency: Use appearance attributes consistently across your survey for a uniform look.
- Mobile vs. Web: Consider how appearances will render on different devices and platforms.
- Performance: Be cautious with appearance attributes that might slow down form loading (e.g.,
table-listfor large groups). - User Experience: Choose appearances that make data entry easier and more intuitive for respondents.
- Testing: Always test your form on target devices to ensure appearances work as expected.
Advanced Techniques
Combining Appearances
Some appearance attributes can be combined for more complex layouts:
| type | name | label | appearance |
|------|------|-------|------------|
| select_one options | choice | Select one: | minimal compact |
Dynamic Appearances
rtSurvey allows for dynamic appearance changes based on form logic:
| type | name | label | appearance | relevant |
|------|------|-------|------------|----------|
| text | time | Enter time: | inline-[%H:%M] | ${show_time} = 'yes' |
Mobile App Considerations
- Some appearances (e.g.,
quick,signature) are specific to mobile devices. - Test thoroughly on both Android and iOS to ensure consistent behavior.
rtSurvey Extended Appearance Attributes
In addition to standard XLSForm appearances, rtSurvey supports the following platform-specific options:
Data and display control
| Appearance Attribute | Question Types | Description |
|---|---|---|
invisible | any | Hides the field from view while still collecting or calculating its value. Different from hidden type — the field still participates in logic. |
displaytitle | any | Forces display of the field’s label/title even when it would otherwise be suppressed. |
autopull | select_one, select_multiple | Automatically fetches external data to populate choices when the form loads or a trigger field changes. |
floating_hint | text, integer, decimal | Shows the hint text as a floating label above the input field rather than below it. |
calculate-button | calculate | Adds a visible button that triggers recalculation of the field on demand, rather than computing automatically. |
Layout
| Appearance Attribute | Question Types | Description |
|---|---|---|
1screen | group | Forces the entire group to display on a single screen regardless of group size. |
columns(n) | select_one, select_multiple | Displays choices in n columns. Example: columns(3) shows three columns of radio buttons. |
gridformat<row=R col=C colspan=S align=center> | any | Positions the field in a CSS-grid layout at row R, column C, spanning S columns. Used with advanced-extension/grid-layout. |
ignore-simplify | any | Instructs the form renderer to skip automatic simplification or condensing of this field’s layout. |
Widgets
| Appearance Attribute | Question Types | Description |
|---|---|---|
likert | select_one | Presents choices as a Likert scale row (already in standard table above; confirmed supported). |
distress | select_one | Renders choices as the Kessler Psychological Distress Scale (K10) visual widget with emotional icons. |
API integration
| Appearance Attribute | Question Types | Description |
|---|---|---|
callapi | text, integer, decimal, select_one | Enables API call integration for this field. The calculation column should contain a callapi() expression. See Call API. |
callapi-verify(params) | text, integer, decimal | Triggers an API verification call using static parameters. The form blocks progress until the API confirms the value. |
callapi-verify(dynamicParams) | text, integer, decimal | Same as callapi-verify but with parameters derived from other field values at runtime. |
Inline date/time format
For date, time, and datetime fields, you can specify a custom display format using a format string appended to the appearance:
inline-[%d/%m/%Y]
inline-1line-[%d/%m/%Y %H:%M]
Format tokens are the same as format-date() and format-date-time(). See Functions — Date and time functions.
Example:
| type | name | label | appearance |
|---|---|---|---|
| datetime | event_time | Event date and time | inline-[%d/%m/%Y %I:%M %p] |
| date | birth_date | Date of birth | inline-[%d/%m/%Y] |
Known Limitations
- Complex appearances may not render identically across all platforms.
- Some advanced rtSurvey appearances may not be supported in offline mode.
Troubleshooting Appearance Issues
- Appearance Not Applied: Check for typos in the appearance column.
- Inconsistent Rendering: Verify compatibility with the question type and platform.
- Performance Issues: Consider simplifying complex appearances, especially for large surveys.