mWater / mwater-forms

Forms controls for mWater
GNU Lesser General Public License v3.0
3 stars 5 forks source link

Roster matrix site questions available in schema #212

Closed Autio closed 4 years ago

Autio commented 5 years ago

Make roster matrix site questions available in data source selection. From the workplan

When creating datagrids when the user selects the data source, allow them to link to surveys which have site questions in a roster matrix, and not just as individual questions at the survey level. Users will be able to select data fields from that roster matrix row, as well as from other questions from the survey, to bring into the datagrid alongside the site data. This data source link between survey roster matrix site questions and sites will be available in dashboards and maps as well.

This is for LienAid and needs to be done ideally by end of month.

broncha commented 4 years ago

@Autio isn't this what we are talking about here? https://portal.mwater.co/#/datagrids/1adf121aea1a49d586653178923e39a2

The rows are from a survey roster matrix from this survey https://portal.mwater.co/#/forms/e9a6b313432d4875b3c60652f7e0f5a5/responses

Autio commented 4 years ago

That datagrid uses the roster as the data source. What they want is to start from the site as the data source and link to the survey even if the site is in the roster matrix. Is that possible?

So for example the survey HH survey_MN.IPE has responses which lists all the water points a household uses. Could I pick water points as a data source, then select the survey as a related survey on the basis of the roster matrix site question link, and build a table or datagrid that way? Don't seem to be able to.

grassick commented 4 years ago

It should be adding the reverse join in FormSchemaBuilder. If it's not working, it's a bug.

broncha commented 4 years ago

Fixed in 49d7980d9511980d13d7520174b04ab2533b33bb. The filter to contain site questions was not detecting site questions in rosters. But this makes really complex queries.