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

Sanitize column names to follow defined standards #313

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

Sujanadh
Copy link
Contributor

Description:

This feature includes functionality to standardize all column names to contain lowercase letters without space within.

  • Adds a function standardize_xlsform_sheets to remove spaces and lowercase all column headers, fixes formatting for columns with '::' (e.g., multilingual labels) in both the 'survey' and 'choices' sheets of an XLSForm.

Issue:

When a user uploads a custom form with some column names like label::English (en) with a space between English and (en), it will create duplicate columns with existing mandatory form fields label::English(en) having multiple same labels for language columns. Due to this there was an issue of not showing questions while loading in odk collect.

"label::Swahili(sw)": [name],
"label::French(fr)": [name],
"label::Spanish(es)": [name],
"label::english(en)": [name],
Copy link
Member

@spwoodcock spwoodcock Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice addition!

@Sujanadh
Just checking that forms definitely work with the lowercase label? Did you manage to test anywhere? 🙏

(I don't see why not, as it should match the (en) key, but need to be sure!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, i tested it

@spwoodcock spwoodcock merged commit 46555e7 into main Nov 15, 2024
3 of 5 checks passed
@spwoodcock spwoodcock deleted the feat/sanitize-columns-header branch November 15, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants