Hi,
I'd like to create a year selector on the dashboard using a date field I have.
Can this be done or do I need to create a year field in Survey123 connect. If I do how do I do that and ensure it's hidden.
Thanks
Rachel
Solved! Go to Solution.
Without a "year" field, this can be fairly tedious, but it's possible.
Without Adding a Field
If your dataset has lots of years, this is a very unappealing option. Add to it the fact that you can't reorder the choices, so you'd better do them in ascending order, or future years will be at the bottom of the list out of sequence.
Adding a Year Field: Update w/ Field Calculator
An alternative would be to add such a field and periodically use the Field Calculator to populated it based on the date field.
Such a task could be scheduled easily enough with the arcgis python module.
Adding a Year Field: Update Via Survey123 Connect
Pulling the year out of a date field in Survey123 is not too difficult. With a 'year' field in place, use the format-date() expression in the calculation and default fields of the XLS speadsheet:
format-date(now(), '%Y')
or
format-date(${some-other-field}, '%Y')
Whichever of those expressions meets your needs. Then set the type column to "hidden". End users will not see the "year" field, but it will be included in form submissions.
Oh and lastly. I don't know if it'll let you, but do not name your field "year", as that can mess up some internal stuff, it being a "reserved keyword".
However you do it, with a specific field corresponding to the year, you simply create a Category Selector, select Grouped Values, then choose your year field as the Category Field. Then your selector will auto-populated with new values as submissions come in.
Without a "year" field, this can be fairly tedious, but it's possible.
Without Adding a Field
If your dataset has lots of years, this is a very unappealing option. Add to it the fact that you can't reorder the choices, so you'd better do them in ascending order, or future years will be at the bottom of the list out of sequence.
Adding a Year Field: Update w/ Field Calculator
An alternative would be to add such a field and periodically use the Field Calculator to populated it based on the date field.
Such a task could be scheduled easily enough with the arcgis python module.
Adding a Year Field: Update Via Survey123 Connect
Pulling the year out of a date field in Survey123 is not too difficult. With a 'year' field in place, use the format-date() expression in the calculation and default fields of the XLS speadsheet:
format-date(now(), '%Y')
or
format-date(${some-other-field}, '%Y')
Whichever of those expressions meets your needs. Then set the type column to "hidden". End users will not see the "year" field, but it will be included in form submissions.
Oh and lastly. I don't know if it'll let you, but do not name your field "year", as that can mess up some internal stuff, it being a "reserved keyword".
However you do it, with a specific field corresponding to the year, you simply create a Category Selector, select Grouped Values, then choose your year field as the Category Field. Then your selector will auto-populated with new values as submissions come in.
Josh, thank you so much.
I added the field year_ into Survey123 and just sent a test and it successfully updated the year field..
Now to update all my dashboards with year options.
Thanks again for such a comprehensive reply.
Rachel