|
POST
|
OK, that makes sense. I wonder how offline data will work in Field Maps with attribute rules. Hmmm.. Thanks for your help!
... View more
03-28-2023
05:41 AM
|
0
|
0
|
1781
|
|
POST
|
Hi, So I'm creating a WebMap that am hoping to use in Field Maps for doing field inspections on Manholes. In ArcGIS Pro I have everything setup; my layers with symbology, an inspection table with a relate to the manhole layer, and attribute rules on the inspection table to automatically set some values on the manhole layer each time a new inspection is added or edited. In ArcGIS Pro everything is working as expected. When I got to "Share - Web Map" I get loads of errors, all of which are pretty cryptic. I guess my questions for now are: 1. can I created a web map with attribute rules embedded in it? 2. will Field Maps work with attribute rules? I was just at the Dev Summit and was told this would work. If you need specific details on my errors let me know, but there are quite a few of them. Here is a screen shot.
... View more
03-27-2023
02:47 PM
|
0
|
2
|
1819
|
|
POST
|
All other values would work if I only had one type of INSP_STATUS, but I have 4 different values that INSP_STATUS could possible be. So 5 types of subtypes and 4 types of INSP_STATUS. That's a total of 20 different combinations of symbols if I did it all manually, but there has got to be a better way of doing this.
... View more
03-27-2023
12:53 PM
|
0
|
1
|
3070
|
|
POST
|
Manual Breaks?? I'm not sure what you are talking about. I'm using Unique Values with two attributes....Subtype Code and INSP_STATUS. I'm not symbolizing numerical data.
... View more
03-27-2023
12:08 PM
|
0
|
1
|
3095
|
|
POST
|
So I need to symbolize based on two attributes: the INSP_STATUS and the Subtype. If there is no INSP_STATUS (ie. = null), than each subtype will have a different symbol. But....if there is an INSP_STATUS (ie. a few different options), than regardless of the Subtype, they can all be the same symbol. This is what I have so far....a symbol for each subtype: When I try to add a custom value with some conditional statement for the "YES" INSP_STATUS to cover all of the sybytpes, I just get an error: Does anyone know how to accomplish this?? Or do I just need to make a symbol for every possible combination of INSP_STATUS and Subtype??
... View more
03-27-2023
11:47 AM
|
0
|
18
|
4681
|
|
POST
|
Sorry @JohannesLindner . I actually think it is working. After trying again it's working now. Thanks for your help!! I was actually talking about this with the Field Maps team while at the Dev Summit a couple weeks ago. It was their idea to try Attribute Rules to automate some logic we are currently using in ArcPad applications in our transition to Field Maps. It looks like this will work. Thanks again!
... View more
03-24-2023
06:14 AM
|
0
|
0
|
4900
|
|
POST
|
Hi @JohannesLindner OK, so an update here... I made some code changes and it appears that when you run the "Verify" it is using the first record in the table, not the last. So that definitely helps to know when troubleshooting. So if I edit that first record, I seem to get the results I am expecting in 'verify' mode, but when adding a new record, I do not see any change to the hydrant INSP_STATUS. Any ideas what might be going on?? // Calculation Attribute Rule on the inspection table
// field: leave empty
// triggers: insert
// exclude from application evaluation
console("TEST")
// get the hydrant feature
var hydrants = FeaturesetByName($datastore, 'WAT_Hydrant', ['FACILITYID', 'ObjectID'], false);
var facility_id = $feature.FACILITYID;
var hydrant = First(Filter(hydrants, 'FACILITYID = @facility_id'));
//Check for an Out of Service (OOS) inspection first
if (($feature.OUT_OF_SERVICE != null) && ($feature.DATEWORK == null))
{
console("OOS")
// abort if no hydrant was found
if(hydrant == null) { return };
//update INSP_STATUS in the hydrant layer to OOS
return {
'edit': [{
'classname' : 'WAT_Hydrant',
'updates' : [{
'objectID': hydrant.ObjectID,
'attributes' : {'INSP_STATUS' : 'OOS'}
}]
}]
};
}
//Next, check to see if it's a Work Required (WR) inspection
if ((($feature.HYDRANT_OPERATION != null) || ($feature.OPERATING_NUT != null) || ($feature.NOZZLE_CAPS != null) || ($feature.FLANGES != null) || ($feature.SECONDARY_VALVE != null) || ($feature.WATER_IN_BARREL != null)) && ($feature.DATEWORK == null))
{
console("WR")
// abort if no hydrant was found
if(hydrant == null) { return };
//update INSP_STATUS in the hydrant layer to OOS
return {
'edit': [{
'classname' : 'WAT_Hydrant',
'updates' : [{
'objectID': hydrant.ObjectID,
'attributes' : {'INSP_STATUS' : 'WR'}
}]
}]
};
}
//If it gets this far, then it's just a normal inspection, so set it to Inspected (YES)
console("YES")
console(hydrant.FacilityID)
if(hydrant == null) { return };
return {
'edit': [{
'classname' : 'WAT_Hydrant',
'updates' : [{
'objectID': hydrant.ObjectID,
'attributes' : {'INSP_STATUS' : 'YES'}
}]
}]
};
... View more
03-24-2023
06:06 AM
|
0
|
0
|
4902
|
|
POST
|
Hi @JohannesLindner . Yes, I have seen that before, but in this case when I run the "Verify" it is not coming up. Here is my code where I inserted the console message, so it should come up everytime. But what is happening when I hit this verify? What is this running against? There are records in my table this rule is getting set on, but how does it (or I) know what record is being used when I hit the verify button? if (($feature.OUT_OF_SERVICE != null) && ($feature.DATEWORK == null)) {
// get the hydrant
var hydrants = FeaturesetByName($datastore, 'WAT_Hydrant', ['FACILITYID', 'ObjectID'], false)
var facility_id = $feature.FACILITYID
var hydrant = First(Filter(hydrants, 'FACILITYID = @facility_id'))
console(hydrant.ObjectID)
// abort if no hydrant was found
if(hydrant == null) { return }
//update INSP_STATUS in the hydrant layer to OOS
return {
'edit': [{
'classname' : 'WAT_Hydrant',
'updates' : [{
'objectID': hydrant.ObjectID,
'attributes' : {'INSP_STATUS' : 'OOS'}
}]
}]
}
}
... View more
03-24-2023
05:17 AM
|
0
|
1
|
4904
|
|
POST
|
Hi Jonannes. Ok, so that error message I was getting was becuase I didn't have a GlobalID on my inspection table, so I added that, updated the code as per your sample above, and it kind of sort of works. I don't get any errors, but I also don't get INSP_STATUS to update. I've insert a console statement to try and do some debugging, but where to the console statements come out? I can't seem to find a console window or anything in Pro.
... View more
03-23-2023
12:18 PM
|
0
|
1
|
4913
|
|
POST
|
Hi, So what I am doing is trying to update the Inspection Status (INSP_STATUS) of a feature, based on an inspection records that is getting populated in a separate table....both in the same database. So far this is what I have setup as a "Validation" rule on the table the inspections get saved in. So if the newly created inspection meets the criteria to be marked as "Out of Service" I need to update the INSP_STATUS field of the feature to "OOS". The inspection/feature have a common field of FACILITYID. When I 'verify' the code I get the green check, but when I try to save the attribute rule, I get a red mark and it tells me I need to use a GlobalID. Is there a way to do this without using the GlobalID?? if (($feature.OUT_OF_SERVICE != null) && ($feature.DATEWORK == null)) { //update INSP_STATUS in the hydrant layer to OOS return { 'edit': [{ 'classname' : 'WAT_Hydrant', 'updates' : [{ 'FACILITYID' : $feature.FACILITYID, 'attributes' : { 'INSP_STATUS' : 'OOS' } }] }] } }
... View more
03-23-2023
08:59 AM
|
0
|
7
|
4942
|
|
POST
|
Hi, yes, I have been building this step by step, so the names are correct. I just did a re-type of the code and now it seems to be working. Maybe the order in which the fields are updated makes a difference?? Or the formatting of how I have things typed in?? Now it looks like this and seems to be working. This is my first time working in Arcade. It seems very finicky.
... View more
03-21-2023
10:20 AM
|
0
|
0
|
1581
|
|
POST
|
Oh geez. Yeah....that is a problem. Always good to have a second set of eyes, but still something is not working even with this update. Those are for sure the correct field names. return {"result" : {"attributes" : {"FACILITYID" : "HYD-" + intersectingGrid.GRIDNO + "-" + NextSequenceValue("SeqHydrants"), "GRIDNO" : intersectingGrid.GRIDNO}}}
... View more
03-21-2023
09:55 AM
|
0
|
1
|
1585
|
|
POST
|
Hi, I'm following the tutorial here: https://community.esri.com/t5/attribute-rules-videos/update-multiple-fields-with-a-single-attribute/m-p/1016597#M16 , but can't seem to get this to work. Can anyone provide some insight?? //first get the intersecting grid var gridNo = FeatureSetByName($datastore, "LAND_Grid", ["GRIDNO"], false); var intersectingGrid = first(intersects(gridNo, $feature)); //return nothing if no intersection if (intersectingGrid==null) {return null}; return {"result" : {"attributes" : {"FACILITYID" : "HYD-" + intersectingGrid.GRIDNO + "-" + NextSequenceValue("SeqHydrants"), "GRIDNO" : gridNo} } }
... View more
03-21-2023
08:53 AM
|
0
|
4
|
1615
|
|
POST
|
Nope, but creating a new attribute rule with seemingly the same settings seems to have worked. Go figure.
... View more
03-21-2023
07:32 AM
|
0
|
0
|
814
|
|
POST
|
So I'm working on some Arcade code to create a specific format of ID when a new feature is created. My code is below, which seems to compile OK, and is giving me the result I am expecting in the console window, but the attribute field on the actual feature is not getting updated. Any advice on why my code isn't working? Thanks!
... View more
03-21-2023
06:24 AM
|
0
|
2
|
836
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-19-2018 05:53 AM | |
| 1 | 04-13-2018 10:07 AM | |
| 1 | 04-13-2018 10:04 AM | |
| 1 | 04-13-2018 05:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-20-2025
03:53 PM
|