Populate attribute table based on proximity of other layer
I have a map with a layer that already has a working add point workflow. One of the fields that needs to be populated in order for the point to be created is whether or not it is within city limits. I currently have a checkbox that populates the field with 0 if the point is not within any city limits or a -1 if it is.
I would like get rid of the check box and have the field automatically populate based on whether or not the new point intersects the city limits layer or not.
I found the free Attribute Assistant extension for ArcMap, and it works great inside ArcMap, but it does not work when a user adds a point from the Geocortex map.
Does anybody know of any way to automatically populate the field from a workflow?
0
-
Use a Query Task on a layer with the city limits and use the geometry of the point to add as input for the geometry.
If this query returns features fill the field with -1 else 0.0 -
Thank you for your response, Nico! That helped a lot, except I'm not sure I got the workflow right. It always assigns 0, even if the point is within city limits. Here's a snapshot. (theFeature is the variable for the point location.)
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g00y&feoid=Body&refid=0EMf2000000kCqa" _/_img_0 -
The Where parameter may be required.
Try adding "1=1"0 -
Thanks for the suggestion, Dan! It still doesn't work properly though. Unless I didn't enter it right. I also tried playing around with the if task (>= 1, or =0 and switching the assign values), but that didn't work either._img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g018&feoid=Body&refid=0EMf2000000kCqf" _/_img_ 0 -
I was just looking at the worklfow I had used (based on the Citizen Service Request demo) and it looks like maybe you don't need the Where clause. Mine only had Geometry and an OutField (only "OBJECTID").
Try CityLimitesGeometry.Features.Count > 0 for the condition
Does 'theFeature' exist before you run the query?
This is where I would start putting Alerts everywhere to double-check things exist/have values.0 -
I deleted the Where clause and put OBJECTID as the out field, but it still doesn't work. The first alert shown below is what comes up when I just have the CityLimitsGeometry variable in the text field, and the second one is CityLimitsGeometry.Count.toString. It shows 1 for the count, so it looks like it's putting out the correct value, but it's just not assigning the proper value from the Then statement. It still always populates the field with 0.
And yes, 'theFeature' is created earlier in the workflow. It represents where the new point is created. The rest of the workflow populates the other fields properly (based on user inputs).
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g01I&feoid=Body&refid=0EMf2000000kCqu" _/_img_
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g01I&feoid=Body&refid=0EMf2000000kCqz"_/_img_
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g01I&feoid=Body&refid=0EMf2000000kCr4"_/_img_0 -
So the Query task is work, that's good.
That means the issue is either Condition or the Assign.0 -
Try CityLimitsGeometry.Features.Count > 0
An alternative is CityLimitsGeometry.Features.Any, this returns True or False0 -
Hello Nico, I tried both of these, and they show the correct value (either a 1 or True) when I put them in the alert box, but it always assigns a 0 to the field. I even switched the values to "Yes" and "No", and it still gives me 0... I have the
Item.Attributes("CityLimits") in the To field for both of the assign activities. Is that missing anything? I even put an alert after the If condition and changed the text to make sure the workflow was updating in the map.0 -
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000g01c&feoid=Body&refid=0EMf2000000kCrd" _/_img_ 0 -
Is CityLimits the exact fieldname? What is the field type? 0 -
Yes, CityLimits is the exact field name. It's a text field (50-character limit). 0 -
Ok, now I feel stupid... I felt sure that I had everything right in the Query and in the If condition, so started moving the whole sequence to different parts of the workflow when I discovered that the assign box for the output of the checkbox was still in the workflow. I could have sworn I deleted it after I deleted the checkbox, but maybe I didn't save or something. At any rate, I deleted it for sure this time, and it works now! Thank you so much for all of your help! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
13 Kommentare