Hi,
Relatively new Survey123 user here. I'm working on a species recording form for a wildlife monitoring programme. The surveyor selects a survey site from a multiple choice list, for which there are associated survey waypoints. When the user selects the site, a choice filter restricts the survey waypoints to those present in that site (e.g. Site 1 contains waypoints 1-20). During the survey, the surveyor should visit every waypoint, and record if any species were found at it or not. At the end of the survey, I want to include a note that warns them they have not recorded species presence/absence at every available waypoint for that site if they have not done so. This will be dependent on whether all waypoints have been selected during the form, using a relevant function that must compare the number of waypoints surveyed to the number available at that site. Is there a way I can get the Survey123 form to:
I have considered I could use an if statement combined followed by a count function to log when each waypoint is selected throughout the form repeats, but for this monitoring scheme there could eventually be 100's of sites, with 1000's of waypoints which makes this unsuitable (I may instead store these in an external_select, rather than storing these in the choice tab of the XLSForm). The other part of this potential workaround would be to use pulldata to identify the number of waypoints associated with a site, but I don't know how I would pull off the if statement issue with such a large number of waypoint options.
Any suggestions?
Thanks in advance.
Rob
#Survey123
Solved! Go to Solution.
So after some testing and discussions with an ESRI consultant, we came up with a solution. Sharing here in case anyone else has the same issue.
General background:
Process:
name: Waypoint_label
calculation: jr:choice-name(${Waypoints},'${Waypoints}')
name: Waypoints_checkedThis text field shows which waypoints have been checked so far.
calculation: join(",",${Waypoint_label}
relevant: not(contains(${Waypoint_checked}, pulldata('Waypoints','Waypoint1','SiteName',${SiteName})))
calculation: pulldata('Waypoints','Waypoint1','SiteName',${SiteName})
name: Waypoint_1This then allows concatenation below without additional commas appearing if a site did not have the maximum number of waypoints, compared to if we just concatenated the outputs from the pulldata calculation (step 3.2).
relevant: string-length(${Waypoint1})>0
calculation: concat(${Waypoint1}," ")
name: WaypointsNotChecked
calculation: concat(${Waypoint_1},${Waypoint_2},${Waypoint_3},${Waypoint_4},
<center><b>Warning!</b> The following waypoints for ${Site_label} have not been checked: <b></center>
<center><b><font color="red">${WaypointsNotChecked}</font></b></center>
<center>If these are missing, please add records for these waypoints and select <i>missing</i> from <i>status</i>. <b>Only proceed if you are finished</b></center>
The warning notes are dependent on a relevant calculation which hides them if the string length of WaypointsNotChecked is 0.
So in summary, the user gets two outputs at the end of the survey form: a list of waypoints checked so far (Waypoints_checked), and a warning showing the waypoints which have not been checked.
Thanks Doug Browning and others for their input.
Have you tried setting repeat count to 20. Then make something required on each repeat. They they must fill out all 20 to submit.
Unfortunately the number of waypoints is different per site so this approach wouldn't work. Furthermore the number and location of waypoints will vary over time as they are added or removed. Thanks for the suggestion though.
Get Outlook for Android<https://aka.ms/ghei36>
You can put a formula in repeat count.
As you said a pulldata would work.
What we do is have the Plots on Collector with a Point count. Send that point count over to 123 via a URL into the repeat count field. Form auto adjusts based on this.
I do this to adjust all kinds of things on the form Plot by plot.
Thanks for the useful suggestions Doug Browning. I'll see if I can work out a way to make this work. One issue we have is that records are not just made at the waypoints, so the number of repeats needed would often exceed the number of waypoints, or a subset of waypoint repeats combined with non-waypoint repeats may trick the form in to thinking it has reached the allocated number of waypoints. It may be worth mentioning that this is for a reptile survey, so the waypoints will be artificial refugia / cover boards, but other records may be collected along the survey route. Furthermore as this is for a citizen science project, we are trying to reduce the need for volunteers to have to use Collector, instead using Explorer and Survey123 in the field, or just Survey123 on the desktop when they are back from the field if preferred by the user.
Hmm. Ok a few more ideas.
Do a join() then contains(joinfield, ''). This will tell you if any blanks. I thought about coalesce but that is just 2 values.
I wonder if count(repeat) counts blanks or not. Not sure.
But rereading your post you just want to count way points. On each repeat can you have something like
if(waypoint,1,0). Then use count() on that field (outside the repeat) and compare it to the way point number you want.
Hope I am understanding it right.
Hmm that could work. I'll do some testing. Thanks for the suggestions.
So after some testing and discussions with an ESRI consultant, we came up with a solution. Sharing here in case anyone else has the same issue.
General background:
Process:
name: Waypoint_label
calculation: jr:choice-name(${Waypoints},'${Waypoints}')
name: Waypoints_checkedThis text field shows which waypoints have been checked so far.
calculation: join(",",${Waypoint_label}
relevant: not(contains(${Waypoint_checked}, pulldata('Waypoints','Waypoint1','SiteName',${SiteName})))
calculation: pulldata('Waypoints','Waypoint1','SiteName',${SiteName})
name: Waypoint_1This then allows concatenation below without additional commas appearing if a site did not have the maximum number of waypoints, compared to if we just concatenated the outputs from the pulldata calculation (step 3.2).
relevant: string-length(${Waypoint1})>0
calculation: concat(${Waypoint1}," ")
name: WaypointsNotChecked
calculation: concat(${Waypoint_1},${Waypoint_2},${Waypoint_3},${Waypoint_4},
<center><b>Warning!</b> The following waypoints for ${Site_label} have not been checked: <b></center>
<center><b><font color="red">${WaypointsNotChecked}</font></b></center>
<center>If these are missing, please add records for these waypoints and select <i>missing</i> from <i>status</i>. <b>Only proceed if you are finished</b></center>
The warning notes are dependent on a relevant calculation which hides them if the string length of WaypointsNotChecked is 0.
So in summary, the user gets two outputs at the end of the survey form: a list of waypoints checked so far (Waypoints_checked), and a warning showing the waypoints which have not been checked.
Thanks Doug Browning and others for their input.