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 #1427

Closed
ukanga opened this issue Jun 4, 2018 · 0 comments
Closed

Support exporting labels for selects in the data #1427

ukanga opened this issue Jun 4, 2018 · 0 comments

Comments

@ukanga
Copy link
Member

ukanga commented Jun 4, 2018

Export select choices with their name or labels

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 |

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 |

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 include_labels=true:

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

Ref

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

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

1 participant