|
POST
|
The other question is are you talking about different features within the same feature class or the same ID in multiple feature classes. If it is the first then a field calculation using @ZachBodenner solution would work. A simpler way to write @ZachBodenner attribute rule is: iif( $feature.ID == 1 && $feature.Result != 'YES' , 'YES' , $feature.Result ) But that is assuming that you simply don't want any changes, otherwise you can change $feature.Result to NULL or whatever returned value you want in its place. If it is the latter then you would need to use an attribute rule for a python script to accomplish that.
... View more
01-23-2025
06:50 AM
|
0
|
0
|
2337
|
|
POST
|
The functions below work for ArcGIS Enterprise 10.8 and later. I have used these two functions quite often since these automatically account for matching field names but don't account for field types. // Get matching field names found in both lists
function GetMatchingFields( FieldListA, FieldListB ){
var MatchingFields = Null
var separator = ','
// Loop through the list of field names in list A
for ( var a in FieldListA ){
for ( var b in FieldListB ){
if ( FieldListA[ a ] == FieldListB[ b ] ){ MatchingFields += FieldListA[ a ] + separator }
}
}
if ( IsEmpty( MatchingFields ) == False ){ MatchingFields = split( MatchingFields , separator ) }
return MatchingFields
}
// Get field names from input features
function GetFieldNames( InputDictionary , OmitFields ){
var FieldNames = Null
var separator = ','
for ( var field in InputDictionary ){
// Populate the specified list with the field name
var keep = True
for ( var i in OmitFields ){
if ( field == OmitFields[ i ] ){ keep = False ; Break }
}
if ( keep == True ){ FieldNames += field + ',' }
}
if ( IsEmpty( FieldNames ) == False ){ FieldNames = split( FieldNames , separator ) }
return FieldNames
} The functions below were updated to use on Enterprise 10.9 and later. // Get matching field names found in both lists
function GetMatchingFields( FieldListA, FieldListB ){
var MatchingFields = []
// Loop through the list of field names in list A
for ( var a in FieldListA ){
if ( Includes( FieldListB , a ) ){ Push( MatchingFields , a ) }
}
if ( Count( MatchingFields ) == 0 ){ MatchingFields = Null }
return MatchingFields
}
// Get field names from input features
function GetFieldNames( InputFeature , OmitFields ){
if( TypeOf( InputFeature ) == 'Feature' ){ InputFeature = First( InputFeature ) }
var FieldNames = []
for ( var field in InputFeature ){
// Populate the specified list with the field name
if ( !Includes( OmitFields , field ) ){ Push( FieldNames , field ) }
}
if ( Count( FieldNames ) == 0 ){ FieldNames = Null }
return FieldNames
} It would be nice if functions like these were added to the library of functions in arcade since it is fairly standard and would be easier to use.
... View more
01-14-2025
09:59 AM
|
3
|
2
|
1176
|
|
POST
|
Hi @Laura, I failed to realize that the code that I sent you does not work in terms of field calculations but it will work as an attribute rule. If you create an attribute rule and use the code expression as the one that was sent, and run an arbitrary calculation then it should work.
... View more
01-13-2025
01:56 PM
|
0
|
0
|
2868
|
|
POST
|
So there is another simple work around that we are thinking of implementing. The method I came up with is to have a related table with editing disabled. It will still allow users to view the attachment but not edit the table.
... View more
01-07-2025
11:12 AM
|
0
|
0
|
2762
|
|
POST
|
Hi @GreerJarrett, A few things to ask in order to figure out the direction. Is there a specific attribute that these points can be filtered by. Are these points timestamped. If the answer is yes to both, then this can easily be accomplished. var fs = $featureset
var QueryField = 'fieldname'
var QueryValue = $feature.fieldvalue
var Query = QueryField + ' = @QueryValue'
var DTField = 'DateTimeField'
var fs = Filter( fs , Query )
var Cntfs = Count( fs )
if( Cntfs >= 2 ){
var topfs = Top( OrderBy( fs , DTField + ' DESC' ) , 2 )
var N = 0
var A = Null
var B = Null
for( var i in topfs ){
if( N < Cntfs ){ A = topfs[ i ] }
else{ B = topfs[ i ] }
N++
}
if( !IsEmpty( A ) && !IsEmpty( B ) ){
var ATime = A[ DTField ]
var BTime = B[ DTField ]
var DTDiff = DateDiff( ATime , BTime , 'Seconds' )
var Dist = Distance( Geometry( A ) , Geometry( B ) , 'Unit' )
var Speed = Dist/DTDiff
// If you need to round the speed, simply use Round( value , decimal places )
if( Speed > 0 ){ return Speed }
}
} You can simply use the expression to create an attribute rule and then run some anonymous field calculation to trigger the rule. You cannot do this in a field calculation, at least to the best of my knowledge. Another option is to use Tracking Functions but only if you have GeoAnalytics.
... View more
01-02-2025
06:17 AM
|
1
|
0
|
2257
|
|
POST
|
Hi @MatthewTrabu, I have documentation but I'm need to upload the updated version. I plan on restructuring my code eventually since I've gotten more efficient with the new language.
... View more
12-20-2024
04:12 PM
|
0
|
2
|
1787
|
|
IDEA
|
Hi @sjvorona., The ability already exists, what you can do is dock all of your attribute tables in a single window on a separate window. When you close the main window, all of the tables will close also.
... View more
12-05-2024
01:58 PM
|
0
|
0
|
2667
|
|
POST
|
So the item id is found in the features url and the layer id is simply the number that is found at the end of the url. Most of the time, if it is a single published layer, the item id is 0.
... View more
12-03-2024
12:10 PM
|
1
|
0
|
1594
|
|
POST
|
You may need to utilize the NewID() sql method to generate something similar but it might still give you the same error that we kept running into. We had talked with Esri support regarding this and, due to the issue of the view requiring editing capabilities, we were extremely limited in tackling this issue.
... View more
12-02-2024
11:07 AM
|
0
|
0
|
1323
|
|
POST
|
Hi @Strata_ChrisG , You would need to utilize the Portal functions | ArcGIS Arcade | Esri Developer for hosted/feature services. You first get the portal, followed by the item id, and the layer index of the item( the order from which the service was published).
... View more
12-02-2024
11:02 AM
|
0
|
2
|
1651
|
|
POST
|
Hi @vijaybadugu, We had a similar situation happen and the only recourse we had was to schedule either python script or sql job to update a standalone table. Views cannot be published so we used one of the two as work around.
... View more
11-27-2024
08:09 AM
|
0
|
2
|
1402
|
|
IDEA
|
This idea had been submitted previously also. Add *.DWG file as layer into ArcGIS Online - Esri Community Enable the add data widget to include CAD files. - Esri Community
... View more
11-27-2024
05:00 AM
|
0
|
0
|
1048
|
|
POST
|
Hi @Laura, Try changing the $featureset to just $feature and see how that works. What you could do is take the highest value in the list and then add the object id to create the unique number and then convert that to text and add 'P' at the beginning. Unfortunately, alpha-numeric ids are really difficult to work with because of the fluctuations in values. The code snippet above does work, but it would mostly work with attribute rules. If you truly need something akin to that, then my only other suggestion would be to create an attribute rule, similar to how the field calculation is set up, and then try running a nonchalant calculation to trigger the rule.
... View more
11-13-2024
12:11 PM
|
0
|
2
|
3100
|
|
POST
|
Hi @Laura You simply added the feature value. Delete '$feature.' and it should work. I also forgot to include this in the script. id = Number( Left( id , Count( id ) - 1 ) ) Did you select arcade as the calculation method?
... View more
11-13-2024
10:57 AM
|
0
|
4
|
3109
|
|
POST
|
Hi @Laura So the only way to do this, because you are using alpha numeric values instead of numerical values, is you would need to loop through the entire feature set, removing the p from each value to get the number, and then populate a list of numbers and only returning the maximum number. From there you would simply add 1 to the max and return that number as the new id. var fs = $featureset
var Numbers = []
for( var row in fs ){
var id = row['<insert id field name>']
id = Left( id , Count( id ) - 1 )
Push( Numbers , id )
}
var N = Max( Numbers ) + 1
return 'P'+Text( N ) It is typically recommended to use numerical values for ids unless there isn't another option or because it is used because of some other application/dataset.
... View more
11-13-2024
07:40 AM
|
2
|
6
|
3132
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM |
| Online Status |
Offline
|
| Date Last Visited |
11 hours ago
|