POST
|
It works! Thank you so much! And there are probably more concise ways to do a lot of things in my script, but I've only just started learning Python, so anything that works is a big help!
... View more
02-12-2018
03:19 PM
|
0
|
0
|
531
|
POST
|
I'm trying to write a script tool that, among other things, sets the coordinate system of the map to a given UTM zone based on the attribute data of a shapefile (generated by a spatial join earlier in the script). The relevant bit is as follows: NZone = arcpy.da.SearchCursor(ShpShp, ["UTM_Zone"]) #UTMRef = r"Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 12N.prj" UTMRef = r"Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone " + str(NZone) + "N.prj" MXD = arcpy.mapping.MapDocument("CURRENT") DF = arcpy.mapping.ListDataFrames(MXD)[0] sr = arcpy.SpatialReference(UTMRef) DF.spatialReference = sr (ShpShp is a variable for the shapefile in question, including ".shp") Note that the commented-out line works if I use that instead. This also works if I change the first line to "NZone = 12". Since I want this to work for any potential UTM zone 1 through 20 (all North), I wanted to use the UTM_Zone field that was the result of the spatial join. The field is type string, and the values are written exactly as the projection files display (ie no leading zeroes or anything). Am I using SearchCursor wrong? Everything else seems to work fine; I adapted the rest of the above code from this earlier discussion. Any tips?
... View more
02-12-2018
02:53 PM
|
0
|
2
|
676
|
POST
|
It sounds like you have a yes/no question about bird sightings in your repeat, and then a total number of birds sighted outside the repeat? If that's the case, try adding a hidden/null field inside the repeat with the following calculation: if(selected(${YESNO}, 'yes'), '1', '') Then, you can set your total sightings question with a calculation of if(count(${HIDDENFIELD})>0, '1', '0'). This will give you your default of 1 if there are any 'Yes' answers, and 0 otherwise. OR If your goal was to manually change the 1 to a higher number if there were multiple sightings: Set your total sightings question with a calculation of count(${HIDDENFIELD}). This will count all of times you checked 'Yes', while all 'No' answers and skips will stay out of your total. So, a skipped section will equal 0, or a survey with three 'Yes' and four 'No' answers will equal 3. Again, I'm not sure I have your workflow quite right, but hopefully this is a start.
... View more
02-09-2018
02:35 PM
|
1
|
0
|
676
|
POST
|
Thanks for the reply! I tried the survey you attached and it worked fine as-is. I then modified it to mirror the setup in mine: combined all the pet choices into a single filtered list, and put them on an external_choices sheet. That external_choices seems to be the culprit, because now the survey (including the original unmodified fields) behaves exactly like mine, with missing images and/or text, including in the field app. I've attached this version here, and will PM you my regular survey to compare. I did test a copy of my survey where I took the list in question off of external_choices, and that worked. Not ideal, but works as a stopgap, I guess.
... View more
12-20-2017
08:23 AM
|
0
|
1
|
945
|
POST
|
I'm trying to display images next a list of choices (as seen here and here). I'm able to get it to work just fine until I try to set it up as a cascading select. At that point, the choices appear to filter correctly, but no images (and sometimes no text either) will display, no matter what appearance I use. These are the results of various combinations of attempts: select_one, minimal, no choice filter Image and text select_one, compact, no choice filter image, no text select_one, any appearance, choice filter no image, no text; just blank selection dots. The right number of them, though! select_one_external, any appearance, choice filter no image, just text Is this a known limitation, or is there something I'm overlooking?
... View more
12-19-2017
10:36 AM
|
0
|
5
|
1512
|
BLOG
|
Is there any possibility of allowing notes to have name values without Connect trying to add fields for each one? I've found it very useful on several surveys to name them for easy identification when writing/editing. It's particularly useful when there are several conditional notes that include a lot of html formatting, making them hard to quickly read and identify at a glance in the spreadsheet. Should I just start marking every named note "null" in the bind::esri:fieldType column, or give up trying to include a quick identifier in the name field altogether?
... View more
11-22-2017
07:50 AM
|
0
|
0
|
8857
|
POST
|
This youtube tutorial shows how to include images in a choice list. A location photo could be displayed next to each well in the list. You can still use pulldata() to display other information about the selected wells. The downside of this is that you can only include one image per choice. Or (and this may be too much work depending on how many wells there are) you could have note fields for each well--showing the desired photos--to be displayed via relevant expressions, so that only the selected well's note/photos display to the field personnel.
... View more
11-06-2017
03:05 PM
|
0
|
0
|
557
|
POST
|
One more update: after I tweaked the new survey's settings, description, etc. to match the original survey, custom print templates stopped working again. I removed the custom .tpk I had added to the survey's media folder and republished, and it worked again. Make of that what you will; I'm not sure if that applies to your situation at all.
... View more
11-02-2017
12:37 PM
|
0
|
0
|
5778
|
POST
|
Ok, so just I got mine to work! I tested my template on several other surveys, and found more that wouldn't work. One thing I found in common was each one that didn't work had image questions within a group. I also noticed your image question was within a repeat, so, close enough. I tried creating a new survey from the existing one and this time removing that group, but it didn't work. However, after recreating it from scratch (images no longer in a group), I could finally use a custom print template successfully! I used ArcGIS Pro to append the existing feature service to the new one, and now I can print all my records. It's probably worth testing to see if recreating a survey with images still in a group/repeat would work or not. Maybe that's the cause, or maybe it was just a coincidence. If I lose the ability to print to a template again, I'll be sure to update here with any changes I made in the meantime. For now, though, I suggest recreating your survey from scratch, and finding a way to somehow recreate the multiple-image functionality you want without putting them in a repeat or group.
... View more
11-02-2017
08:33 AM
|
0
|
1
|
5778
|
POST
|
Marc, have you tried uploading other templates? Or have you tried the attached template in another survey? I'm having the same issue right now, and I noticed that it seems to be the survey that's causing the problem, not the template. The same template in another survey works just fine, and templates that have worked for other surveys still hang indefinitely for my one problem survey.
... View more
11-01-2017
10:07 AM
|
0
|
1
|
5778
|
POST
|
We had an issue recently where a user was able to "skip" a required geopoint question in a survey. Apparently, simply opening the survey was enough to get an automatic rough point (usually with accuracies in the hundreds or thousands of meters), and no user input was required. Is this intended behaviour? For what it's worth, there was a warning about bad accuracy, but it and the geopoint question were located in a closed group due to survey size. The user simply never bothered to open the group, for whatever reason. Moving forward, I know I can mitigate this issue in several different ways, but I was surprised that this happened at all. I figured a required geopoint would require actual user input before allowing a survey to be submitted.
... View more
10-27-2017
07:33 AM
|
0
|
3
|
807
|
POST
|
You should be able to nest your if/then statements: if(selected(${Q1},'A'),1, if(selected(${Q1},'B'),3,10)) This will run your second if/then as the else case of your first if/then, and if neither condition is met, then the second else case is the final result.
... View more
10-11-2017
07:49 AM
|
3
|
1
|
860
|
POST
|
You'll want to use "selected()", as in: selected(${AggregateType}, '112'}. This will allow the text field to display whenever that value is selected, regardless of what other values may also be selected. Check out this help article on relevant expressions for further information: http://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformrelevant.htm
... View more
10-10-2017
02:25 PM
|
1
|
0
|
560
|
POST
|
In your situation, I think you should be able to get around this by using a calculation instead: if(selected(${InspectionType}, 'Daily'), 'Pass', ''). These answers can still be edited if needed, and IIRC the survey shouldn't recalculate them again unless you change or re-select the InspectionType answer.
... View more
10-06-2017
02:29 PM
|
0
|
0
|
813
|
POST
|
Without knowing what workflows you're using, this method is one that I've tried with some success: Take the question you want to be conditionally required and make a second copy of it. One copy is marked as required, the other isn't. Each copy has a relevant condition such that only one copy will display. In the case of the required copy, this will be the condition you have in mind that makes this question required. Set both copies as null Have a read-only or hidden question populate with the answer of the above two copies, using an if/then statement based on your original requirement condition. This keeps both of the above copies' answers in the same field. type name label relevant calculation select_one yes_no IsRequired Should this question be required? text NotRequired This question is not required. ${IsRequired}='no' text Required This question is required.* ${isRequired}='yes' text Result This field stores the values of 'Required' and 'NotRequired' if(selected(${IsRequired}, 'yes'), ${Required}, ${NotRequired})
... View more
10-03-2017
12:20 PM
|
3
|
6
|
3820
|
Title | Kudos | Posted |
---|---|---|
1 | 02-09-2018 02:35 PM | |
1 | 10-10-2017 02:25 PM | |
3 | 10-03-2017 12:20 PM | |
3 | 10-11-2017 07:49 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|