|
POST
|
Just a basic question but is there any plans to update arcade so that ide indents like it does for other languages? I don't know if this question has been asked but I have been using other ides( Code Writer ) to write the code needed simply due to syntax and indentation. Specifically regarding ArcGIS Pro.
... View more
02-27-2025
07:25 AM
|
1
|
11
|
3318
|
|
POST
|
It isn't always straight forward and it does confuse some people, especially if you program in several languages, and simply getting the syntax just right is confusing by itself.
... View more
02-27-2025
05:22 AM
|
1
|
0
|
2640
|
|
POST
|
I have posted a blog of sorts in the Arcade group that shows the updated script.
... View more
02-26-2025
02:32 PM
|
0
|
0
|
1642
|
|
POST
|
Hi @MaximeDemers, Have you looked into List Datasets or Walk for that matter. That should help guide you to identify the list of datasets, but if you are looking to get the list of datasets using the feature class filepath then here is a sample below. import arcpy
Workspace = '<some sde or gdb>'
Walk = arcpy.da.Walk( Workspace , datatype="FeatureDataset" )
for root, dirname, filenames in Walk:
print( dirname )
for filename in filenames:
print( '<something>' )
... View more
02-25-2025
08:31 AM
|
2
|
1
|
4971
|
|
POST
|
Hi @DNMCSCADA, That helps a lot with that information that you provided. So try one of these options below to see which one gets you in the right information that you are looking for. function FindNull( InputArray ){
var NonEmptyValues = []
for( var i = 0; i< Count( InputArray ) ; i++ ){
if( !IsEmpty( InputArray[ i ] ) ){
Console( InputArray[ i ] , ' is not empty' )
Push( NonEmptyValues , InputArray[ i ] ) }
return NonEmptyValues
}
var A = Intersects( Geometry( tempfs ) , fsRoads )
if( Count( A ) > 0 ){ A = First( A ) }
var B = Intersects( fsRoads , Geometry( tempfs ) )
if( Count( B ) > 0 ){ B = First( B ) }
var C = Intersects( Geometry( fsRoads ) , tempfs )
if( Count( C ) > 0 ){ C = First( C ) }
var D = Intersects( tempfs , Geometry( fsRoads ) )
if( Count( D ) > 0 ){ D = First( D ) }
var Check = FindNull( [ A , B , C , D ] )
Console( Check )
return Console( Check ) I often get confused at times when it comes to the geometry vs the attributes of the features I am trying to get. The other thing is the permissions to the layer that you are trying to create which might be keeping you from creating the layer in the first place. That is another potential possibility to consider.
... View more
02-25-2025
04:39 AM
|
0
|
4
|
2660
|
|
POST
|
Just out of curiosity, have you tried testing this locally to see if any of the features overlap at all. If nothing overlaps, then regardless of the direction, there won't be any results. Also, what kind of geometries are you using. If it is points and lines, then that might be the challenge since it would be very difficult to identify whether the points or lines intersect in the first place, but there are ways to identify which is the closest point to a line.
... View more
02-24-2025
09:49 AM
|
0
|
6
|
2663
|
|
POST
|
Hi @samshrma998, Here are some things that need to be taken into consideration when editing from the field that you may or may not have thought about. Cell service - if there are instances of weak or no cell service then this can cause issues when editing in the field. If the service is too weak then you may need to try and reconfigure the service by testing these parameters: Reducing sample size than what the default sample size is. Decreasing when the layers draw when zooming out Using offline data collection - if you are using offline data collection but the field crews are not regularly pushing updates then that could be causing problems. When there is too much data being collected in the field that isn't regularly updated then the amount of data is too large to send. You may need to reconsider what kind of versioning to use in this instance. Too many edits being done at once - if there are too many edits happening simultaneously then that could potentially cause issues as well. If branch isn't working, then try using traditional versioning to see if that makes a difference.
... View more
02-20-2025
09:37 AM
|
1
|
0
|
2821
|
|
BLOG
|
Hi @BriannaEttley I do need some help with moving this. I tried to post it to the Arcade space but I had difficulty finding where to put it.
... View more
02-19-2025
12:31 PM
|
1
|
0
|
971
|
|
BLOG
|
The thing is this code can be utilized for multiple datasets or multiple scenarios so it would be difficult to say what would fit. We update this code whenever we need changes to be pushed to other datasets without needing to manually edit those features.
... View more
02-19-2025
10:56 AM
|
0
|
0
|
985
|
|
IDEA
|
Rule of thumb typically for these, and many others, is: Survey132: For acquiring information from the public Quick Capture: For getting information fast to for AI projects or rapid reporting Field Maps: For data pulling from multiple sources or utilizes data from different database servers There might be others but this is how we identify the type of information, how fast do we need it, and if the data is needing to be populated using different sources.
... View more
02-19-2025
10:54 AM
|
0
|
0
|
935
|
|
POST
|
Try removing the First(<feature>) and simply use the layer. The issue with using first is that it pulls the first record in the table which may not intersect with the other layer. If the layers intersect, then you can then use the first function to get that specific record.
... View more
02-19-2025
05:02 AM
|
0
|
8
|
2708
|
|
BLOG
|
Here is the workflow that is utilized for creating near real-time updates along with some code snippets that makes editing more streamlined. This works for both features/tables created in enterprise sde databases and file geodatabases. The workflow works best when using published services from an enterprise sde database that are published to either AGO or an enterprise portal. Create an attribute rule using the following code below. /*
The function below updates the edit array depending on what kind of edits are
needing to be applied.The edits are based on the input dictionary of the type
of edit.
*/
function PopulateEditsArray( EditArray , OIDs , Values ){
var Values = {}
if( TypeOf( Values ) == 'Dictionary' ){ Values.attributes = Values }
if( TypeOf( OIDs ) == 'Number' ){ Values.OBJECTID = OIDs }
Push( EditArray , Values )
return EditArray
}
/*
The function below checks the values( dictionary ) and compares it to the input
feature( dictionary ) and checks for any changes. Returns true if any of the
values are not identical.
*/
function CheckDifferences( Infeature , CheckValues ){
var Check = False
for( var field in CheckValues ){
if( HasKey( Infeature , Field ) && Infeature[ Field ] != CheckValues[ field ] ){ Check = True ; break }
}
return Check
}
/*
The function below populates the edit array with the editing features and
attributes of either tables and/or feature classes that will be updated by the
edit array.
*/
function FeatureEdits( EditFeature , TableName , Values ){
var FeatureEdits = { className : TableName }
var ApplyEdits = False
for( var i in Values ){
if( Count( Values[ i ] ) > 0 ){
FeatureEdits[ i ] = Values[ i ]
ApplyEdits = True
}
}
if( ApplyEdits ){ Push( EditFeature.edit , FeatureEdits ) }
return EditFeature
}
/*
List of field names to be used or searched for in the given feature/table.
*/
var OIDField = 'OBJECTID'
var DateTimeField = '<DateTimeEField>'
/*
Expects pulls all information in a feature and is returned as a dictionary
of field names and attributes. Using the field names above, it is easier to
independently reference a single field name than having to type the field
name multiple times. When used in conjunction with '$feature', the field name
variable can be used as bracket notation to get the attribute value.
*/
Expects( $feature , '*' )
var OID = $feature[ OIDField ]
var DateTimeValue = $feature[ DateTimeField ]
var Example = $feature['<otherfield>']
/*
When working with an enterprise sde database, the schema owner may be different
so by assigning the owner as a variable makes it easier for changing the owner
if copying the code to a different database. The variable for table or feature
names can be used in conjunction with the schema owner to get the complete table
name.
*/
var CharSep = '.'
var SchemaOwner = '<SchemaOwner>'
var TableOrFeature_Name = "<TableOrFeature_Name>"
/*
The dictionary below is populated, however needed but the setup below is the one
that I find easiest. Here is the breakdown of the dictionary that is populated
below.
'FS'
This the key for identifying the feature class/table that is being edited.
The name has to be written fully. The table name cannot be referenced by avariable
'Query'
This is used to query the feature, if needed, to filter the data based on the query.
'DefaultValues'
This is used to compare values using the function 'CheckDifferences' that is intially created
You can add as many features as needed to the table set below as needed.
*/
var TableSets = {}
TableSets[ TableOrFeature_Name ] = {
'FS' : FeatureSetByName( $datastore, "<TableOrFeature_Name>", [ <'Array of Field Names'> ] ),
'Query' : OIDField + ' = @OID',
'DefaultValues' : Dictionary( DateTimeField , DateTimeValue )
}
//Repeat the same setup as above for multiple tables.
/*
Set any required condition to apply the edit to the feature. Not doing so may cause issues
with updating the table/featureclass in the dictionary above or cause slow downs
*/
if( !IsEmpty( Example ) ){
// Set the result to the main field for the attribute rule
var EditInfo = { result : Example , edit : [] }
// Loop through the list of table/feature names in the dictionary above
for( var TableName in TableSets ){
// The values dictionary is the default for populating the array of
// edits depending on the type of edits that needes to be applied.
var Values = { adds : [] , updates : [] , deletes : [] }
// Get the values of the dictionary
var TableInfo = TableSets[ TableName ]
// Apply the filter to the feature/table if the query is not empty
var Table = TableInfo.FS
if( !IsEmpty( TableInfo.Query ) ){ Table = Filter( TableInfo.FS , TableInfo.Query ) }
// Get the dictionary of values
var ValueDict = TableInfo.DefaultValues
// Get the row count of the table( optional )
var TableCount = Count( Table )
//If the name matches the specified table/feature name
if( Tablename == TableOrFeature_Name ){
// If the count is equal to 0 then add the record
if( TableCount == 0 ){ PopulateEditsArray( Values.adds , Null , ValueDict ) }
// If the count is equal to 1 then get the first record
else if( TableCount == 1 ){
Table = First( Table )
// If there are changes in the attributes then update the table
if( CheckDifferences( Table , ValueDict ) ){ PopulateEditsArray( Values.updates , Table[ OIDField ] , ValueDict ) }
}
}
/*
Set the edit dictionary to the function that is created above.
If using an sde feature/table then set the 'schema owner' + 'char' + 'tablename'.
If there is no character separator or schema/database owner then simply include
the feature/table name.
*/
if( !IsEmpty( SchemaOwner ) || !IsEmpty( CharSep ) ){ TableName = SchemaOwner + CharSep + TableName }
EditInfo = FeatureEdits( EditInfo , TableName , Values )
}
// Apply the edit to the featureclass/table if the edit array count is greater than 0
if( Count( EditInfo.edit ) > 0 ){ return EditInfo }
} Next you will want to create a separate table with a single field, ideally a date and time field, to be updated by the code above. Change the following in the code above var TableSets = {}
TableSets[ TableOrFeature_Name ] = {
'FS' : FeatureSetByName( $datastore, "<TableOrFeature_Name>", [ <'Array of Field Names'> ] ),
'Query' : OIDField + ' = 1',
'DefaultValues' : Dictionary( DateTimeField , Today() )// Modify to match the date field in the newly created table
} Note** You can modify the code to look for different conditions, but dates typically are easier to utilize. After the table is created, do the following: Create another attribute rule using the same code above to populate other feature classes/tables. Be sure to change the query conditions/checks/ and any other conditions in order to update the other features properly. Set the field to the date time field created to only trigger to look like the following if( DateValue == Today() )// Line 97 Set the trigger fields to either insert and/or udpate Check "Exclude from Application" If done correctly, every time the conditions are met, the edits should apply to all features every time the table above is updated, or more profoundly, whenever this table is updated by any other feature.
... View more
02-18-2025
12:08 PM
|
3
|
4
|
1674
|
|
POST
|
Hi @MelissaGearman, A couple of things. Your code isn't set to update a record from another feature class/table rather it is set to pull and update the record from the related table. Meaning that the record itself would have to be edited in order for it to populate. If you are looking to simply pull and update a record from a related table, here is the modified code below. var sourceTable = FeatureSetByName($datastore, "ROWAcqParcelsTable", ["*"], false)
var key = $feature.PIN
var selectFeature = First( Filter( sourceTable , "PIN = @key") )
iif( !IsEmpty( selectFeature ) && selectFeature.PIN == key , "YES" , "NO" )
... View more
02-18-2025
12:01 PM
|
0
|
0
|
1516
|
|
IDEA
|
@MitchellDrennan Here is the process I am trying to describe. Check the 'Automatically select related records' under the Related data in the selection properties of the layer Apply the filter layer extent in the attribute table Select all the records in the table within the filtered extent and have the selected records displayed in the other table. It is still a manual process but until ESRI re-incorporates some old functionality then this might be the only work around. It is the closest I could find.
... View more
02-18-2025
08:52 AM
|
0
|
0
|
2628
|
|
IDEA
|
@MitchellDrennan I get what you were trying to do now. I am trying a few things to see if I can mimic the behavior you are looking for but I believe that, without any spatial data, it will be hard to do. In terms of navigating by map series page that still exists but it looks like the image below. It will work if you have the layer/table properties set to select all related records but that still may not help your case. If you still cannot find a solution, then I would suggest an idea to ESRI to see if that functionality can be brought back. I don't see why not.
... View more
02-18-2025
06:06 AM
|
0
|
0
|
2645
|
| 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 |
yesterday
|