|
POST
|
Hi @l_al-sabbagh Here are the things that I would recommend to help you along. For sizable attachments or commonly associated attachments. If the attachments are fairly sizable, > 50MB or larger and database storage is potentially an issue, then it would be advisable to create a separate table that has those attachments with a unique ID per attachment that is updated automatically in that table. Create a relationship class with that table with any other features and assigning that ID will automatically have that attachment associated with it. For small attachments then it can be attached to multiple features unless of course those features share identical information Versioning is pretty straightforward so depending on when a version is edited then you can identify, using version management, what changes were made and when. Answered by the first Always use a separate IDs since the other features already have their own identification We are currently looking to implement a similar solution and this is the route we are taking.
... View more
03-18-2025
01:17 PM
|
2
|
1
|
1558
|
|
POST
|
Hi @VictorGutzler , The second line populates an array of field names using the field name dictionary and the value populates a dictionary which is later added to an array as values.
... View more
03-18-2025
09:35 AM
|
0
|
0
|
2735
|
|
POST
|
Thanks @KenBuja for showcasing a better way to write when statements. I am still working on improving the use of the functions and the concatenating text resulting in a text value I completely forgot about. We are using a portal that is one version and several point releases behind the latest portal version, so somethings work and others don't. But next time we upgrade, I will be sure to update my code bases to better work using simpler code.
... View more
03-17-2025
10:24 AM
|
0
|
0
|
2767
|
|
POST
|
It is ultimately, when combined with a modified html, to look like this.
... View more
03-17-2025
07:20 AM
|
1
|
0
|
2795
|
|
POST
|
So the error that I came across is due to the featureset not likeing alphnumeric field names for integers or strings. To bypass this; I created a list of alphabetical letters and then indexed those for the field names which seemed to bypass that issue. function GetPctColor(P){
var Color = When(
P >= 0 && P < 5,'#d01111',
P >= 5 && P < 10,'#cc2211',
P >= 10 && P < 15,'#c83311',
P >= 15 && P < 20,'#c34211',
P >= 20 && P < 25,'#bf5112',
P >= 25 && P < 30,'#bb5f12',
P >= 30 && P < 35,'#b76c12',
P >= 35 && P < 40,'#b37912',
P >= 40 && P < 45,'#af8512',
P >= 45 && P < 50,'#ab9012',
P >= 50 && P < 55,'#a79a12',
P >= 55 && P < 60,'#a2a312',
P >= 60 && P < 65,'#919f12',
P >= 65 && P < 70,'#819b12',
P >= 70 && P < 75,'#719712',
P >= 75 && P < 80,'#639312',
P >= 80 && P < 85,'#558f11',
P >= 85 && P < 90,'#478b11',
P >= 90 && P < 95,'#3b8711',
'#2f8311'
)
return Color
}
var Alph = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V']
var fields = []
var V = {}
var counter = 0
for( var i=5; i<= 95; i=i+5 ){
if( i%5 == 0 ){
var l = Alph[ counter ]
var f = {'name':l, 'type':'esriFieldTypeSmallInteger'}
Push( fields , f )
V[ l ] = i
var n = {'name':'c'+Text(i), 'type':'esriFieldTypeString', Length:7}
Push( fields , n )
V[ 'c'+Text(i) ] = GetPctColor(i)
counter++
}
}
var Ramp = {
'fields': fields,
'geometryType':'',
'features' : [{ attributes : V }]
}
Ramp = FeatureSet(Text(Ramp))
return Ramp
... View more
03-17-2025
07:14 AM
|
1
|
2
|
2798
|
|
POST
|
Hi, I typically don't have issues with arcade expressions but for some reason this one is returning the error message: "Unable to execute arcade script for Feature ObjectedID 0" function GetPctColor(P){
var Color = When(
P >= 0 && P < 5,'#d01111',
P >= 5 && P < 10,'#cc2211',
P >= 10 && P < 15,'#c83311',
P >= 15 && P < 20,'#c34211',
P >= 20 && P < 25,'#bf5112',
P >= 25 && P < 30,'#bb5f12',
P >= 30 && P < 35,'#b76c12',
P >= 35 && P < 40,'#b37912',
P >= 40 && P < 45,'#af8512',
P >= 45 && P < 50,'#ab9012',
P >= 50 && P < 55,'#a79a12',
P >= 55 && P < 60,'#a2a312',
P >= 60 && P < 65,'#919f12',
P >= 65 && P < 70,'#819b12',
P >= 70 && P < 75,'#719712',
P >= 75 && P < 80,'#639312',
P >= 80 && P < 85,'#558f11',
P >= 85 && P < 90,'#478b11',
P >= 90 && P < 95,'#3b8711',
'#2f8311'
)
return Color
}
var fields = []
var Values = {}
for( var i=5; i<= 95; i=i+5 ){
if( i%5 == 0 ){
var f = {'name':'n'+Text(i), 'type':'esriFieldTypeSmallInteger'}
Push( fields , f )
Values[ 'n'+Text(i) ] = i
f = {'name':'c'+Text(i), 'type':'esriFieldTypeString', Length:7}
Push( fields , f )
Values[ 'c'+Text(i) ] = GetPctColor(i)
}
}
Console( Values )
var Ramp = {
'fields': fields,
'geometryType':'',
'features' : [{ attributes : Values }]
}
Ramp = FeatureSet(Text(Ramp))
return Ramp
... View more
03-17-2025
06:11 AM
|
0
|
8
|
2827
|
|
POST
|
Your issue is that you have this in your code trying to populate an array but it is set to populate a dictionary. combinedDict.features[i] So you want to change it to look like the example below. for (var m in polygon_field){
var A = {
attributes: {
CatCode : m["Cat28Code2025"],
Notes : m["Notes2025"],
Condition : m["Ocondition2025"],
Source : "Polygon"
}
}
Push( combinedDict.features , A )
} I am also throwing this example in here to showcase a simpler manner to write the same code. function CreateDictValues( InArray , InFeature , Fields , Geometry ){
for( var row in InFeature ){
var Values = iif( !IsEmpty( Geometry ) , { Source : Geometry } , {} )
var Valid = False
for( var field in row ){
if( HasKey( Fields , field ) ){
field = Fields[ field ]
Values[ field ] = i[ field ]
Valid = True
}
}
if( Valid ){ Push( InArray , { attributes: Values } ) }
}
return InArray
}
//Loop through each FeatureSet and populate feature array
var PopValues = []
var F = {"Cat28Code2025":'CatCode',"Notes2025":'Notes',"Ocondition2025":"Condition","RBU":"BusinessUnit"}
CreateDictValues( PopValues , point_field , F , "Point" )
CreateDictValues( PopValues , polyline_field , F , "Point" )
CreateDictValues( PopValues , polygon_field , F , "Point" )
// Return dictionary cast as a feature set
var combinedDict = {
fields:[
{name : "CatCode",type : "esriFieldTypeSmallInteger"},
{name : "Notes",type : "esriFieldTypeString"},
{name : "Condition",type : "esriFieldTypeDouble"},
{name : "BusinessUnit",type : "esriFieldTypeString"},
{name : "Source", type : "esriFieldTypeString"},
],
'geometryType':"",
'features':PopValues ,
}
return FeatureSet(Text(combinedDict))
... View more
03-13-2025
03:55 AM
|
0
|
0
|
1677
|
|
POST
|
@CodyPatterson has the right method but I am simply putting this one out there to show a simpler way of writing the same code. // Option A
var D = $feature.Incorporation_Date
iif( !IsEmpty( D ) , "Incorporated on " + Text(D, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" , Null )
// Option B
var N = Null
if( !IsEmpty( $feature.Incorporation_Date ) ){ N = "Incorporated on " + Text($feature.Incorporation_Date, "MMMM D, YYYY") + " (" + $feature.Incorporation_Citation + ")" }
return N
... View more
03-06-2025
11:01 AM
|
2
|
0
|
2553
|
|
POST
|
Hi @BaileyDeSimone, Your arcade expression is returning the hyperlinks as text values which is why they cannot be read so that may be the issue. var state = $feature.Name
var inc_citation = $feature.Incorporation_Citation
var Value = Null
var url = WHEN(
state == 'Alaska', Value ='<p><a href=${https://tile.loc.gov/storage-services/service/ll/cfr/cf/r1/95/90/03/-T/3C/I/cfr1959003-T3CI/cfr19590... target="_blank">${inc_citation}</a></p>',
state == 'New Mexico', Value ='<p><a href=${https://tile.loc.gov/storage-services/service/ll/llsl/llsl-c62/llsl-c62.pdf#page=2005} target="_blank">${inc_citation}</a></p>'
)
if( !IsEmpty( Value ) ){ return Value } One thing you can try is to paste the full hyperlink in a field and then use arcade to pull both links when the attributes match. Another option is to create a standalone table, copy and paste the hyperlinks in one field and designate the corresponding attribute in another. Then when you create the popup you can reference that table and attribute which should get you the corresponding link.
... View more
03-06-2025
10:53 AM
|
0
|
0
|
1735
|
|
POST
|
Hi @samshrma998 Can you possible break down the rough details and workflow, starting from the generated service to editing in the field? Things such as: Number of layers/datasets symbology type imagery used layer drawing scales number of editors portal (enterprise vs AGO ) service type ( hosted vs reference ) Applications used ( field maps , survey123, workforce, etc ) The more information the better so that either I or someone else can help possibly pinpoint the exact issue.
... View more
03-03-2025
08:49 AM
|
0
|
1
|
2738
|
|
POST
|
Yes and I forgot to change it to the different letters. I was preoccupied with something and I failed to see that. I will have the code that I sent you updated.
... View more
03-03-2025
06:46 AM
|
0
|
0
|
2579
|
|
POST
|
Your suggestion unfortunately does not work in pro. In either arcgis online and enterprise portals it does indent but the pro version does not.
... View more
02-27-2025
08:47 AM
|
0
|
1
|
2741
|
|
POST
|
I mean it adds a few spaces so you can identify when a new line or working with dictionaries or arrays. 'un-indented code'
{
'Indented line of code'
}
... View more
02-27-2025
08:44 AM
|
1
|
0
|
2743
|
|
POST
|
If you already have the file paths for the feature class then you can simply use o.path.split(filepath)[0] to get the dataset. Datasets are generally treated like subfolder in gdbs and sdes. You can check if the file path is a dataset vs an .sde or .gdb by simply checking if those exists at the end of the file path.
... View more
02-27-2025
08:39 AM
|
0
|
0
|
801
|
|
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
|
3314
|
| 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 |
Friday
|