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

Support exporting labels for selects in the data #1421

Closed
ukanga opened this issue May 23, 2018 · 3 comments
Closed

Support exporting labels for selects in the data #1421

ukanga opened this issue May 23, 2018 · 3 comments

Comments

@ukanga
Copy link
Member

ukanga commented May 23, 2018

Proposal

Add an boolean export parameter show_choice_labels that will accept true or false. This option will allow the labels of choices to be included in the submission data being exported. There are two possibilities:

  1. For each row where there is a choice was selected the user will see the label of the choice instead of the choice itself.
  2. We add an extra column, 'field_name:label' that will include the label of the choice in the 'field_name'.

Given the XLSForm:

| survey  |
|         | type              | name  | label  |
|         | select one fruits | fruit | Fruit  |
|         |                   |       |        |
| choices | list name         | name  | label  |
|         | fruits            | 1     | Mango  |
|         | fruits            | 2     | Orange |
|         | fruits            | 3     | Apple  |

The export currently will look like:

| fruit | meta/instanceID |
| 2     | a1234567890abcd |
| 1     | b1234567789efgh |

With the export parameter show_choice_labes=true then we have the same export as:

| fruit  | meta/instanceID |
| Orange | a1234567890abcd |
| Mango  | b1234567789efgh |

Or with the option to have an extra labels field column, with the export parameter show_choice_labels=true then we have the same export as:

| fruit | fruit:label | meta/instanceID |
| 2     | Orange      | a1234567890abcd |
| 1     | Mango       | b1234567789efgh |

For select multiple questions:

| survey  |
|         | type                   | name  | label  |
|         | select_multiple fruits | fruit | Fruit  |
|         |                        |       |        |
| choices | list name              | name  | label  |
|         | fruits                 | 1     | Mango  |
|         | fruits                 | 2     | Orange |
|         | fruits                 | 3     | Apple  |

The export currently will look like:

| fruit | meta/instanceID |
| 1 2   | a1234567890ijkl |
| 2 3   | b1234567789mnop |

With the export parameter show_choice_labes=true then we have the same export as:

| fruit        | meta/instanceID |
| Mango Orange | a1234567890ijkl |
| Orange Apple | b1234567789mnop |

Or with the option to have an extra labels field column, with the export parameter show_choice_labels=true then we have the same export as:

| fruit | fruit:label  | meta/instanceID |
| 1 2   | Mango Orange | a1234567890ijkl |
| 2 3   | Orange Apple | b1234567789mnop |

For select multiple questions where the parameter value_select_multiples is true and split_select_multiples is also true, the export will be as:

| fruit | fruit/1 | fruit/2  | fruit/3 | meta/instanceID |
| 1 2   | Mango   | Orange   |         | a1234567890ijkl |
| 2 3   |         | Orange   | Apple   | b1234567789mnop |

With label as separate column:

| fruit | fruit/1 | fruit/1:label | fruit/2  | fruit/2:label | fruit/3 | fruit/3:label | meta/instanceID |
| 1 2   | 1       | Mango         | 2        | Orange        |         |               | a1234567890ijkl |
| 2 3   |         |               | 2        | Orange        | 3       | Apple         | b1234567789mnop |

With include_labels=true:

| fruit | fruit/Mango | fruit/Orange  | fruit/Apple | meta/instanceID |
| 1 2   | Mango       | Orange        |             | a1234567890ijkl |
| 2 3   |             | Orange        | Apple       | b1234567789mnop |

With include_labels=true and label as a separate column:

| fruit | fruit/Mango | fruit/Mango:label | fruit/Orange  | fruit/Orange:label | fruit/Apple | fruit/Apple:label | meta/instanceID |
| 1 2   | 1           | Mango             | 2             | Orange             |             |                   | a1234567890ijkl |
| 2 3   |             |                   | 2             | Orange             | 3           | Apple             | b1234567789mnop |

Decision required

Should we replace the select field or add an extra field:label column to show the labels?

Ref

Aha! Link: https://ona.aha.io/features/PROD-342

@msschroeder
Copy link

For the 2 possibilities:

1. For each row where there is a choice was selected the user will see the label of the choice instead of the choice itself. 2. We add an extra column, 'field_name:label' that will include the label of the choice in the 'field_name'.

Both options are practical, but my only concern with option two is the number of columns, especially for already wide forms. I would probably opt for option 1 for this reason.

@ukanga
Copy link
Member Author

ukanga commented May 30, 2018

I also lean towards option 1.

@ukanga
Copy link
Member Author

ukanga commented Jun 4, 2018

Implementation issue is #1427

@ukanga ukanga closed this as completed Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants