|
POST
|
Hi Doug, thanks for the response! I've attached the XLS form. Unfortunately, yes as far as I can tell, I need to pass in the entire repeat to do the calculations I need, for multiple repeats. If you have any suggestions for improvements though I'm all ears. For version 3.14, it is still only available through the EAC, right?
... View more
01-03-2022
07:00 AM
|
1
|
3
|
6470
|
|
POST
|
So, after many many hours of work and research, I was so excited to finally get my complex survey built in Survey123 Connect ready to publish. The survey is big. The XLS Form has 187 rows, there are five different .js files with multiple functions in each of them. There are external choice lists with thousands of different species names for the region, which use the "pull data" function to autopopulate their indicator status. There are also many other calculations and dependencies built within the form. I thought I was already doing what was recommend as "best practice" for large surveys (i.e. using the Page style, using external choice lists, etc) but even with doing all of this, the survey crashes on iOS (apparently related to a bug that is supposed to be fixed in the 3.14 version release of the field app). When opening on Android, it doesn't crash but the survey takes 2.5 minutes to open. Is there anything else I can be doing to help optimize the performance of my survey that I'm missing? Or was Survey123 just "not built" to handle surveys like this?
... View more
12-30-2021
12:41 PM
|
4
|
8
|
6540
|
|
POST
|
I am running into this issue today, and the situation you described seems to match mine (a large survey with lots of JavaScript expressions and other calculations.) It's crashing on version 3.13.246 of the field app on iOS. I got the survey to open successfully on version 3.13.234 of the field app on my Android phone. So are you basically saying this is a known bug that won't be fixed until the 3.14 release? Do you know when that will be?
... View more
12-30-2021
11:55 AM
|
0
|
0
|
3177
|
|
POST
|
Would the "count" function do what you need? https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm
... View more
12-30-2021
10:33 AM
|
0
|
1
|
1402
|
|
POST
|
Is the question within a repeat? Is this what you're trying to do? https://support.esri.com/en/technical-article/000021664
... View more
12-30-2021
10:23 AM
|
0
|
3
|
1405
|
|
POST
|
Aww, no problem at all. 🙂 Honestly, I think you nailed the solution on the head...just try making a brand new form from scratch with the same "final" schema you've arrived at now. Hopefully that will be enough to clear out the issue. If you still get weird results...I'll just be biased and say give Survey123 Connect a try 😉 haha! Good luck!
... View more
12-29-2021
10:04 AM
|
1
|
0
|
1913
|
|
POST
|
"Potato, Potahto", as far as I know. I've always used AGOL, but it probably just depends on what one was introduced to when they first started learning web GIS.
... View more
12-29-2021
08:56 AM
|
2
|
0
|
17302
|
|
POST
|
So, I have way more experience designing surveys in Survey123 Connect rather than the web form, but I'll try helping anyway unless someone else comes along who knows exactly what's happening. 🙂 Did you at one point have an extra page or question that you then deleted? Or are there any other dependent questions in the survey? I wonder if it's as simple as needing to be refreshed.
... View more
12-28-2021
04:42 PM
|
1
|
2
|
1953
|
|
POST
|
Thanks for the reply, Josh! That's more or less what I had assumed, but wasn't sure if there was some nuance I was missing.
... View more
12-28-2021
02:31 PM
|
0
|
2
|
5077
|
|
POST
|
In both the "Type" and "Appearance" column of Survey123 there is an option for "hidden". What I'm wondering is, what would be an appropriate use-case for one vs. the other? Why would you ever want a hidden question type rather than a note type with a hidden appearance? Is there a best practice regarding this?
... View more
12-28-2021
02:08 PM
|
0
|
4
|
5084
|
|
POST
|
What settings do you have checked under the collaborate/update survey tab? Make sure the group itself has shared update capabilities, which is set when the group is first created.
... View more
12-28-2021
11:59 AM
|
3
|
1
|
1086
|
|
POST
|
Hmm, so I've never actually followed your exact workflow because I usually need to build more complicated surveys so I need to build them in Connect from the start. But anyway, when you open the survey in Connect now, do you have an option to view the XLSForm? If so, that's how you'd add the new fields (new rows in the excel sheet). And then you'd click Publish as I mentioned before and it would update with the changes.
... View more
12-28-2021
09:36 AM
|
0
|
0
|
6178
|
|
POST
|
Hi Sean, To update the survey, you will simply click "Publish" in Survey123 Connect. The application will warn you if the updates will cause you to lose data or not. For reference, the "Update Surveys" section of this page has a table that lists updates you can make in either the web app or Survey123 Connect and whether they will cause you to lose data or not. https://doc.arcgis.com/en/survey123/browser/create-surveys/publishsurvey.htm Hope this helps!
... View more
12-28-2021
09:28 AM
|
0
|
2
|
6182
|
|
POST
|
Johannes, You have gone above and beyond in assisting me with this. Not only does your solution work, it is more elegant and really helps a novice like me see how I can clean up my coding style. I can't thank you enough! "Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime." Best, Katherine
... View more
12-10-2021
09:31 AM
|
0
|
0
|
3940
|
|
POST
|
Hi Johannes, thanks so much for your reply! Apologies for my delayed response, I got pulled into another project this week. But I'm still hoping you can help! PERC_COVER_FIELD and DOM_SPECIES_FIELD are both fields from the input table. In fact, here's the full script. I'm sure that will be more helpful. Any other suggestions? import arcpy
# GLOBAL VARIABLES
POINT_ID_FIELD = 'AGCP___Wetland_Determination_Data_Form_v2.sampling_point'
PERC_COVER_FIELD = 'herb_stratum_repeat.abs_perc_cover_herb'
DOM_SPECIES_FIELD = 'herb_stratum_repeat.dom_species_herb'
def unique_values(table, field):
""" Create a list that contains all the unique Sampling_Point id's in the table."""
with arcpy.da.SearchCursor(table, [field]) as cursor:
return sorted({row[0] for row in cursor}) # using a set eliminates duplicates
def calc_veg_dom(perc_cover_values, stratum_layer):
"""Applies the 50/20 rule for calculating vegetation dominance. The function creates a list that identifies the
percent values that are for dominant species for a specific sampling point."""
for sample_id, sample_list in perc_cover_values.items():
total_cover = sum(perc_cover_values[sample_id])
perc_cover_50 = total_cover * 0.5
perc_cover_20 = total_cover * 0.2
dom_list = []
for item in sample_list:
dom_list.append(item)
# stop adding items to the list. All values that are in this list are dominant species (50% rule)
if sum(dom_list) > perc_cover_50:
break
# Identify the species that will be evaluated for the 20% rule.
# Creating a copy of the original sample_id list so we do not modify the original
remaining_vals = list(perc_cover_values[sample_id])
for item in dom_list:
if item in remaining_vals:
remaining_vals.remove(item)
for item in remaining_vals:
if item in dom_list and item < perc_cover_20:
dom_list.append(item)
if item >= perc_cover_20:
dom_list.append(item)
arcpy.management.SelectLayerByAttribute(stratum_layer, "NEW_SELECTION",
f"{POINT_ID_FIELD} = '{sample_id}'")
fields = (PERC_COVER_FIELD, DOM_SPECIES_FIELD)
exit()
with arcpy.da.SearchCursor(stratum_layer, fields) as cursor:
for row in cursor:
print(row)
if int(row[0]) in dom_list:
arcpy.management.CalculateField(stratum_layer, DOM_SPECIES_FIELD, "'Y'", "PYTHON3")
print(f"{int(row[0])} is dominant")
else:
arcpy.management.CalculateField(stratum_layer, DOM_SPECIES_FIELD, "'N'", "PYTHON3")
print(f"{int(row[0])} is not dominant")
###########################################################################################################
def main():
fc = arcpy.GetParameterAsText(0)
stratum_table = arcpy.GetParameterAsText(1)
# Make Layer and Table View for the Join
fc_layer = arcpy.MakeTableView_management(fc, "fc_lyr")
stratum_layer = arcpy.MakeTableView_management(stratum_table, "stratum_lyr")
# Join feature class to stratum table based on the parentglobalID and globalID
arcpy.AddJoin_management(stratum_layer, "parentglobalid", fc_layer, "globalid", "KEEP_ALL")
point_id_list = unique_values(stratum_layer, POINT_ID_FIELD)
perc_covers_dict = {}
for id in point_id_list:
perc_covers_list = []
# Select features based on unique "Sampling_Point" name
arcpy.management.SelectLayerByAttribute(stratum_layer, "NEW_SELECTION", f"{POINT_ID_FIELD} = '{id}'")
# Create a dictionary that has all % cover numbers (value) in a list for a sampling ID (key)
with arcpy.da.SearchCursor(stratum_layer, PERC_COVER_FIELD) as cursor:
for row in cursor:
perc_covers_list.append(int(row[0]))
perc_covers_list.sort(reverse=True) # sort values from highest to lowest
perc_covers_dict[id] = perc_covers_list # adds the list as the value for each key (sample id) in a dict
calc_veg_dom(perc_covers_dict, stratum_layer)
if __name__ == "__main__":
main()
... View more
12-09-2021
10:25 AM
|
0
|
2
|
3955
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 3 | 2 weeks ago | |
| 6 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 45 | 2 weeks ago |
| Online Status |
Online
|
| Date Last Visited |
Wednesday
|