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

Link forms through option sets #564

Open
dtygel opened this issue Jan 9, 2019 · 8 comments
Open

Link forms through option sets #564

dtygel opened this issue Jan 9, 2019 · 8 comments

Comments

@dtygel
Copy link

dtygel commented Jan 9, 2019

Hi all,
Congratulations for the excelent work!
Today, ELMO/NEMO can build option sets or import one from a csv or xls file. A nice improvement would be to add a third way, which would be to link to another form, and choose a field from the form.
What do you think about this way of connecting multiple forms?

@smoyte
Copy link
Contributor

smoyte commented Jan 10, 2019

Hi @dtygel! I'm not quite sure what you're suggesting here. Can you explain a bit more and/or provide an example?

@dtygel
Copy link
Author

dtygel commented Jan 14, 2019

One example:

Let's say we have:

  1. A form "Organization" with several fields, including id, name and estate_id;
  2. A form "Equipments" with several fields, including name and id;

The feature proposal is that the field Organization::estate_id might be a multiple options list, based on the form Equipments, having Equipments::id as its value and Equipments::name as label.

In that way, we would connect both forms and dynamically populate the options for the field estate_id in form "Organization".

@smoyte
Copy link
Contributor

smoyte commented Jan 17, 2019

Ok I think I see what you mean now, thanks. That sort of thing is not supported by ODK as far as I know, so that would be the place to start with an idea like this, assuming you want to use ODK.

What is the actual use case here? There may be a different way to achieve it...

@dtygel
Copy link
Author

dtygel commented Jul 20, 2019

Our use case is that we have different objects, which are correlated. Each one of these objects is a form, And in some cases, a form has a "select one" question that has, as options, the data from other form. We have, for example, "networks", which are forms. And we have "organisations", which are also forms. An organization can belong to one or more networks. So we want the user to be able to choose network(s) to which the organization belong.

We are working on a solution which we plan to submit as a PR if you think it could be useful.

The proposal is the following: In the "option sets" page, there will be an option "create option set from form", which will lead to a page where the user will create a name for the option set and choose from a dropdown with all published forms which have at least one key text option. That's it.

Let's say the user created an option set "Networks", where she chose the form "Network". Then, she creates a form "Organisation". When creating questions, she creates a Question "To which network does this organisation belong to?", which is of type "select one", and she chooses the option set "Networks".

When she publishes the form, the option set is populated with all answers from the first key text field in "Network" form.

Whenever there is a new answer to the "Network" form, ELMO will unpublish the "Organization" form, update it's options, and publish it again, with a new formVersion, indicating that it was updated.

Do you think this could be of interest for ELMO/NEMO?

@smoyte
Copy link
Contributor

smoyte commented Jul 22, 2019

Interesting... I like the re-use of the key question concept.

As a slight tweak I'd suggest not having a 'create option set from form' link, but rather just having a "populate from form" checkbox or dropdown in the regular option set form. That would be more consistent with other parts of the app.

But yes I think this could work!

@dtygel
Copy link
Author

dtygel commented Jul 22, 2019

Hi @smoyth : thanks for the suggestion. We'll take it! We've already done part of it. We hope to present very soon a first version of the PR.

@dtygel
Copy link
Author

dtygel commented Sep 29, 2019

We have it already working 100%! But still using the top menu of the option sets, and not directly in the select one/multiple question form. We expect to change it soon to make it a PR.

@cooperka
Copy link
Member

Update in 2020: ODK continues to wish for supporting "longitudinal data" (which is a big change). If they did support this, it might make this type of feature easier. It's a long way off but hopeful! You can check their forum for more updates.

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

3 participants