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

Accessing Choice metadata in a Forumla #131

Closed
MattFoy opened this issue Jul 11, 2018 · 2 comments
Closed

Accessing Choice metadata in a Forumla #131

MattFoy opened this issue Jul 11, 2018 · 2 comments

Comments

@MattFoy
Copy link

MattFoy commented Jul 11, 2018

Apologies if this is already a thing and I'm just being ignorant.

I noticed in the documentation under http://xlsform.org/#cascade, you can make selects filter based on "metadata" from the choices list. In the example given, you add a choice_filter column, and can set it like state=${state} and county=${county}. The "state" and "country" apparently referencing those extra metadata columns from the list of choices.

Rather than filtering, I'd like to display the full list, then merely display or perhaps reference that metadata once a selection has been made. This would be useful for a number of use cases I can think of.

I would expect to be able to access this metadata in a calculation column like ${city->county} or ${city.county} or something like that... or maybe in a relevant column like ${city}->altitude >= 1000 or ${city}.altitude >= 1000.

If this is a thing already, could you please point me towards the proper syntax?

Thanks!

@lognaturel
Copy link
Contributor

lognaturel commented Jul 11, 2018

You can do this! It has no special support in XLSForm but you can use XPath queries and those are just passed through to the form XML. See https://docs.google.com/spreadsheets/d/1mQGVWaJA4QQp3jtddMdcRSDjc1O-j_bB79GUnlj5k10/edit#gid=0 for an example.

XLSForm/pyxform#176 would be a first step towards more native support for this.

In general, something like the ODK forum (https://forum.opendatakit.org/) will be a better place for a usage question. If there is development to be done someone can help direct you to the best repository for filing the issue! If you do have follow-up questions, it would be great if you could create a support question there so a broader range of users can benefit from the answer.

@MattFoy
Copy link
Author

MattFoy commented Jul 11, 2018

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants