Select to view content in your preferred language

selected-at calculation not working in web form

438
4
Jump to solution
02-15-2024 03:12 PM
NoémieBoulanger-Lapointe
New Contributor II

I am trying to use selected-at to force user to enter data in a certain order.

At the beginning of the survey, the user is asked which species were present at the site and how many quadrats were sampled. Based on these answers, a set number of nested repeats appropriately labeled are generated.

The calculation uses the position within the repeat to assign species ID and Quadrat order. It works fines in the field app and Survey123 Connect, but the web form does not recognize the result of the calculation.

See screenshot in Survey123 Connect and attached xls. The issue happened in both repeats at line 27 and 34.

NomieBoulangerLapointe_1-1708038842968.png

 

NomieBoulangerLapointe_0-1708038740815.png

 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Note nested repeats can be funky in the web.  I see they now work for new records but not edits.

I think it may be you have a field named count but that is a reserved word. See the Reserved tab in the xlxs.  Web is a lot more picky about that.

Be aware make sure to test a user going back a few repeats and deleting a record, then adding a new record at the end.  It will dup your numbering.  Not much you can do about it.  We tell users to not do that.  If they need to make a change just change it do not delete.  We still get them sometimes but really we dont worry about numbering as much anymore as we don't really use it for much in newer systems.  I am also not sure how this will work with repeat_count.  I gave up on using it since it preloads all repeats at the start, which broke a lot of my calcs.  But it may negate the delete issue not sure. 

Hope that is it.

 

View solution in original post

0 Kudos
4 Replies
DougBrowning
MVP Esteemed Contributor

Note nested repeats can be funky in the web.  I see they now work for new records but not edits.

I think it may be you have a field named count but that is a reserved word. See the Reserved tab in the xlxs.  Web is a lot more picky about that.

Be aware make sure to test a user going back a few repeats and deleting a record, then adding a new record at the end.  It will dup your numbering.  Not much you can do about it.  We tell users to not do that.  If they need to make a change just change it do not delete.  We still get them sometimes but really we dont worry about numbering as much anymore as we don't really use it for much in newer systems.  I am also not sure how this will work with repeat_count.  I gave up on using it since it preloads all repeats at the start, which broke a lot of my calcs.  But it may negate the delete issue not sure. 

Hope that is it.

 

0 Kudos
NoémieBoulanger-Lapointe
New Contributor II

Unfortunately, changing "count" for a non-designated term did not make it work in the web form. We need the nested repeats to summarize data by species unfortunately. I will use your duplicate check trick instead with a drop-down list.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Bummer.  I would maybe also try to remove the field from the service as it is still in there probably.  But I am not surprised it works different in the web app, esp with nested repeats.

I have seen many people try this summary by attribute but it never seems to work out.  Makes sense forms are just for collecting and not much for analysis. Javascript may be able to pull it off.  I also wonder of the Survey123 website can do this.

For us we do all our summaries later in script after QA and all that.  When people fix items in the web map the calcs do not fire so the summaries are off a lot.  I could see a dashboard Data Expression for this also.  Or a script that runs at night.  I am assuming you transfer from AGOL to a backend permeant storage at some point and that is when we do it.

Well hope that helps some.

0 Kudos
NoémieBoulanger-Lapointe
New Contributor II

Thanks for taking the time to reply, it is really appreciated! Good to know about the unreliability of calculations I will be mindful of that. We do have back end storage but could not figure out a script to pull data together in the map pop-ups without nested repeat. We will go with the Survey123 app although it was not our first choice.