NC Choice Grid
Not yet released: this component will ship in an upcoming Native Rent package version.
NC Choice Grid is a matrix of questions. Rows are the items, and columns are the choices. People give one answer per row (radio) by default, or several per row (checkbox) if you set Selection Mode to multi. It outputs the answers as one text, as a text collection, and as a count of answered rows.
Use it for a condition check or inspection on a Rentable, where each item needs a rating.
Layouts
| Layout | API value | What the user sees | Example |
|---|---|---|---|
| Auto | auto | A table on a wide screen. On a phone or when the component is under 600 px wide, each row becomes a card with block buttons that show the column labels. | A condition check used on desktop and phone. |
| Table | table | A table. A table with many columns scrolls sideways inside the component. | A wide desktop inspection screen. |
| Cards | cards | One card per row, with block buttons for the choices. | A narrow column or a phone. |
Rows, columns, and answers
Rows and columns come from comma-separated text. Use \, for a comma inside a label. Optional Row Values and Column Values can be given in the same order. Blank value entries use the label.
A Text collection can be used instead. When the collection has items, it replaces the text, and each label is also its value.
Duplicate values are dropped. The first entry is kept.
One answer or several: Selection Mode single (the default) works like a radio button per row. Tapping the picked answer again clears that row. With multi, rows work like checkboxes.
Answers (value) outputs the values, not the labels, as one text such as Tires=Good; Body=Fair. With multi it looks like Body=Fair,Damaged. It keeps row and column order. It is empty (null) when nothing is answered. When no Row or Column Value is set, the label is used as the value. For example, a rating grid with Column Values 1,2,3 outputs Cleanliness=2.
Answers (Collection) has one Row=Choice entry per answered row, in row order, for a Loop. With multi, that entry can be Row=A,B.
Answered Rows is the number of rows with an answer.
A progress line such as "2 of 4 answered" shows under the grid.
Mapping Answers in prefills the grid. Rows or columns that no longer exist are dropped.
Do not put =, ; or , in values. Those characters separate the answers. If a label needs one of them, give the row or column a plain value in Row Values or Column Values.
Required means every row needs an answer. Next shows "Answer every row to continue." and outlines the rows that are still open. Each outline clears as soon as that row is answered.
Navigate After Selection works with single selection only. The flow can move on when the last open row is answered.
Without rows or columns, the component shows a setup message.
Add it to a screen
- Add NC Choice Grid to the screen. Set Label, and turn on Required if every row must be answered.
- Enter Row Labels and Column Labels, or map a Text collection for each.
- Optionally enter Row Values and Column Values in the same order as the labels.
- Set Selection Mode to multi if a row can have more than one answer.
- Map Answers in and out of the same variable to prefill or read the grid. Use Answers (Collection) in a Loop, and Answered Rows if you need the count.
Example
A condition check on a Rentable:
- Rows:
Tires,Body,Engine,Attachments. - Columns:
Good,Fair,Damaged. - Required on.
- Loop over Answers (Collection) to create one inspection line per row.
Validation
Next is blocked when the grid is required and any row is still open. The component shows "Answer every row to continue." or your Required Message. Open rows are outlined, and the outline on a row clears when that row is answered. The message shows under the component, not as a Flow error.
When nothing is answered, Answers is sent to the flow as empty (null), not as empty text.
Phone and desktop
Auto shows a table on a wide screen, and one card per row with block buttons on a phone or when the component is under 600 px wide. The block buttons are at least 44 px tall. 44 px touch targets also apply at 600 px or less, on a phone, or on a touch screen. Map Answers in and out of the same variable to keep the answers if the screen is re-created. NC Choice Grid has no Color Map.
Each row is a radio group (single) or a group (multi), named by its row label. Each choice is named "Row: Choice."
Limits
- Do not put
=,;or,in values. - Duplicate values are dropped.
- A Text collection replaces the matching labels text when it has items, and the labels are then also the values.
- A table with many columns scrolls sideways inside the component.
- Required checks every row, not only the rows the user has opened.
Properties
| Property | API name | Default | Description |
|---|---|---|---|
| Label | fieldLabel | (blank) | Question or field label shown above the grid. |
| Help Text | helpText | (blank) | Optional hint under the label. |
| Row Labels | rowLabels | (blank) | Comma-separated items, one per row, e.g. Tires,Body,Engine. Use \, for a comma inside a label. |
| Row Values | rowValues | (blank) | Optional comma-separated values in the same order as Row Labels. Blank entries use the label. |
| Row Labels (Collection) | rowLabelsCollection | (blank) | Optional Text collection of row labels (also used as the values). Used instead of Row Labels when it has items. |
| Column Labels | columnLabels | (blank) | Comma-separated choices, one per column, e.g. Good,Fair,Damaged. |
| Column Values | columnValues | (blank) | Optional comma-separated values in the same order as Column Labels. Blank entries use the label. |
| Column Labels (Collection) | columnLabelsCollection | (blank) | Optional Text collection of column labels (also used as the values). Used instead of Column Labels when it has items. |
| Selection Mode | selectionMode | single | single (default: one answer per row, radio) or multi (several per row, checkbox). |
| Required | required | false | Block Next until every row has an answer. Rows still open are outlined. |
| Required Message | requiredMessage | (blank) | Optional. Blank uses the translated default. |
| Disabled | disabled | false | Show the grid read-only. |
| Layout | layout | auto | auto (default), table or cards. Auto: one card per row with block buttons on phones or under 600px, a table on wide screens. |
| Accent Color | accentColor | (blank) | Selected and focus color, e.g. #0B5CAB. Hex, rgb() or a color name. Lightened or darkened until it reaches 3:1 against the tile color (or the theme surface if no tile is set). Also tints the focus ring and the selected/highlighted row. Blank follows the org theme (and dark mode). |
| Background Color | backgroundColor | (blank) | Optional color behind the whole component. |
| Text Color | textColor | (blank) | Optional. On choices and results: used as-is on the theme surface, or checked at 4.5:1 against a tile color if one is set. On the label and help: checked at 4.5:1 against the background if one is set; otherwise dark or white text is picked automatically. |
| Text Size | size | medium | small, medium (default), large or xlarge. |
| Corner Shape | shape | rounded | rounded (default), square or pill. |
| Alignment | align | start | start (default), center or end. |
| Navigate After Selection | navigateOnSelect | none | none (default), next, back, finish or pause. Single selection only: when the last open row is answered the Flow can move on. Next and Finish check Required first; Next becomes Finish on the last screen. |
| Available Actions | availableActions | (blank) | Set by Flow; do not map. |
Outputs
| Output | API name | Type | Direction | Description |
|---|---|---|---|---|
| Answers | value | Text | Input and output | All answers as one text: Row=Choice; Row=Choice (multi: Row=A,B), using the values. Map in to prefill, out to read. Empty when nothing is answered. |
| Answers (Collection) | answers | Text collection | Output | One Row=Choice entry per answered row, in row order, for a Loop. |
| Answered Rows | answeredCount | Number | Output | Number of rows with an answer. |
Shared behavior
Layout and width, required messages, colors, navigation, data sources, translations, accessibility, and the setup panel work the same way on every component. See NC screen components.
To copy this component's settings to another screen, use Copy settings at the top of its setup panel. See Copy settings.