|
POST
|
Hi @kapalczynski, You can look up the documentation ArcGIS Arcade in addition to Advanced Editing to help you get a better understanding of what the script is doing. Here are my answers to your questsions: The script above will trigger every time some hits submit and so long as whatever conditions are met. If you have multiple status types but you simply want to update the related record, then you would only need to have it to that if the record already exists then it will simply get updated. Updates in arcade look like the code below. var E = {
'edits':[{
'className':'<featureclassname>',
'updates':[{
'OBJECTID': $feature.RelObjID,
'attributes': Dictionary('RelFldA','Value','RelFldB','...')//If fields match then use the same as the original
}]
}]
} Yes. The key is that the fields in one record must be mapped accordingly, otherwise the edits will not apply. I use Defaults as an example variable. You can replace it with anything that works for you. The script above is more of a general example but you can configure it to work however you like. Just make sure that the formatting is done correctly or the variables, fields, etc are the correct ones. If you need to the get the object id of the related record then change the script above to look like the one below. var FiltValue = $feature.RAMPID
var Status = $feature.STATUS
var OrigStatus = $originalfeature.STATUS
var UpdteTble = FeatureSetByName($map,'<Name of table/featureclass>',['<fieldnames>'],False)
UpdteTble = Filter(UpdteTble,'RAMPID = @FiltValue')
/*
var Values = Dictionary('STATUS', $feature.STATUS, fieldB, ValueB, ... )
*/
var Defaults = { result: { attributes: {'STATUS': $feature.STATUS } } }
var Edits = []
if( OrigStatus == 'OPEN' && Status == 'CLOSED' ){
var Changes = Dictionary('className','<TblName>')
var TblDict = Dictionary() // Can use the same values in the values dictionary if the field names are the same
if( Count(UpdteTble)==0 ){
Changes['adds'] = Dictionary('attributes',TblDict)
}
else if( Count(UpdteTble)==1 ){
var OID = First(UpdteTble).OBJECTID
Changes['updates'] = Dictionary('OBJECTID',OID,'attributes',TblDict)
}
Push( Edits, Changes )
}
if( Count( Edits ) > 0 ){ Defaults['edit'] = Edits }
return Defaults
... View more
10-08-2025
07:27 AM
|
0
|
0
|
160
|
|
POST
|
Hi @AmyRoust . Try the following. var P = Portal('https://lawrenceks.maps.arcgis.com/')
var Addr = FeatureSetByPortalItem(P, '0e4a33c0f05e483284f046c220b8f0c0',0,['*'],True)
var Parcs = FeatureSetByPortalItem(P, '8cfd05010c2d4cc499cc701c91e3c2b0','*',['*'],True)
var Test = []
for( var i in Parcs){
var N = First(Intersects( Addr, Geometry(i)))
if( TypeOf(N)=='Feature' ){
N = Dictionary(N).attributes
Console(N)
Push(Test,N)
}
if( Count(Test) <= 10 ){Break}
}
If( Count(Test)>0){ Console(Concatenate(Test,'\n')) } You can play around with it in the Arcade Playground.
... View more
10-07-2025
02:20 PM
|
0
|
0
|
298
|
|
POST
|
Hi @kapalczynski, You can definitely do this in Field Maps. You would simply need to configure the Field Calculation with a script similar to the one below. var FiltValue = $feature.RAMPID
var Status = $feature.STATUS
var OrigStatus = $originalfeature.STATUS
var UpdteTble = FeatureSetByName($map,'<Name of table/featureclass>',['<fieldnames>'],False)
UpdteTble = Filter(UpdteTble,'RAMPID = @FiltValue')
/*
var Values = Dictionary('STATUS', $feature.STATUS, fieldB, ValueB, ... )
*/
var Defaults = { result: { attributes: {'STATUS': $feature.STATUS } } }
var Edits = []
if( OrigStatus == 'OPEN' && Status == 'CLOSED' && Count(UpdteTble)==0 ){
var Changes = Dictionary('className','<TblName>')
var TblDict = Dictionary() // Can use the same values in the values dictionary if the field names are the same
Changes['adds'] = Dictionary('attributes',TblDict)
Push( Edits, Changes )
}
if( Count( Edits ) > 0 ){ Defaults['edit'] = Edits }
return Defaults
... View more
10-07-2025
01:52 PM
|
0
|
2
|
189
|
|
POST
|
Hi @LiveHus, I do not know if this is bug or not since there isn't enough information to be able to troubleshoot without knowing the client side configuration vs your portal configuration. Have you checked the following? (This is based on my previous knowledge since it has been sometime since I have messed with GeoEvent) Are both versions of your portal and the client the same or do they differ Does the service, when brought into the webmap, have all data required or is some of the data missing. Are the data types the same for the rotation field. i.e integer, float, double Have you tried switching from Geographic to Arithmetic to see if the results appear the same despite being the same field? If the answer to all questions is yes then it is likely a bug or a versioning/compatibility issue. Moreso a bug if everything else is working correctly. I have not messed with GeoEvent for some time since we use Velocity so it is difficult to say what the issue actually is.
... View more
10-07-2025
06:35 AM
|
0
|
0
|
233
|
|
POST
|
Hi @KenBuja, Correct me if I am wrong but it might appear that @AmyRoust is referencing a grouped layer which, if it is setup correctly, should be a single service in which case the Within function should work. However, if it is created as separate feature services which are then grouped in the map then that would require a different work around. In which case @AmyRoust could try one of the following below. // Option 1: using union then the within function
var FSets = [
FeatureSetByName($map,'ConditionalZoning'),['*'],True),
FeatureSetByName($map,'LawrenceZoningDistrict'),['*'],True),
FeatureSetByName($map,'DouglasCountyZoningDistrict'),['*'],True)
]
var UnionSets = Union(FSets)
var Address = $feature
var Check = Within(Address,UnionSets)
iif( TypeOf( Check ) == 'FeatureSet', Check, 'Nothing Within')
// Option 2: looping through a list of layers and getting the appropriate values
var FSets = [
FeatureSetByName($map,'ConditionalZoning'),['*'],True),
FeatureSetByName($map,'LawrenceZoningDistrict'),['*'],True),
FeatureSetByName($map,'DouglasCountyZoningDistrict'),['*'],True)
]
var Address = $feature
var TextValues = []
for( var fs in FSets ){
fs = FSets[i]
var V = First(Intersects(Address,fs))
if(TypeOf(intfs)=='Feature'){ Push(TextValues,V['<fieldname>']) }
}
iif( Count(TextValues)>0, Concatenate(TextValues,'\n'), 'Address does not fall within')
... View more
10-07-2025
06:18 AM
|
0
|
4
|
306
|
|
POST
|
Then it might helpful then to use the intersects function to get the information that you need. It may also require that you loop through multiple features to get a dictionary of field values to pull from.
... View more
10-06-2025
03:08 PM
|
0
|
0
|
325
|
|
POST
|
Hi @ErikRose, Are you looking to have it setup so that when the related record is updated that the main feature will also update? Somethings to consider in your script. You can use either GlobalIDs or ObjectIDs as a means of updating another feature. You can use other ids to filter by but updates should only require an object id or global id. I don't think you can force a calculation but rather set it up so that when there is a change to a feature, whether it be an update or insert, you can set the rule to trigger based on one of those conditions using the $editcontext.editType and specify 'INSERT' or 'UPDATE' triggers are identified. If you want it to update another feature then I would recommend the following below. // the "asset id" field e.g. "SWGM-1002" in the related records
var id = $feature.Feature_Name
// Are variable names case sensitive here? Is 'globalid' != 'GLOBALID'?
var out = FeatureSetByName($datastore, "pipe_maintenance", ['globalid', 'assetid'], false)
// The related records include outfall inspections (no pipe reference), so the filter can return Null
var devices = Filter(out, "assetid= @ID")
var device = When(Count(devices) > 0, First(devices), Null)
// Can I conditionally return here?
if (typeof(device) == 'feature' {
return {
'result': {'attributes': Dictionary(fieldname,value) }, 'edit': [{
'className': "STORMWATER.pipe_maintenance",
"updates" : [{ 'attributes': {fieldname, fieldvalue},'globalID': device.globalid }]
}]
}
}
... View more
10-06-2025
01:28 PM
|
1
|
2
|
301
|
|
POST
|
Hi @LiveHus, Just out of curiosity, have you tried publishing the service as a reference with the rotation of the symbols as part of the service. It could be a bug but sometimes publishing a referenced source offers more control of symbology than the typical portal map.
... View more
10-06-2025
01:15 PM
|
0
|
2
|
253
|
|
POST
|
Hi @AmyRoust, So the within function returns a feature set of the features that fall within the specified layer. If you have an instance where some layers may overlap others then what I might suggest is any of the following. var FS = FeatureSetByName($map, 'Zoning Districts - Lawrence Zoning District',['ZoningDistrict'],True)
var Address = $feature
if( TypeOf(Geometry($feature)) == 'Polygon' ){ Address = Centroid($feature) }
var AddrWithin = Within(address,FS)
iif( Count(AddrWithin)>0, AddrWithin, 'No features are within the layer')
/*
Note: the intersects function can also be used if the input layer is a point feature.
*/
... View more
10-06-2025
01:11 PM
|
0
|
2
|
337
|
|
POST
|
My recommendation is to test whether the feature geometry has changed in comparison to the field values. var fx = $feature.UTM_X
var fy = $feature.UTM_Y
var G = Geometry($feature)
if( G.x != fx && G.y != fy ){
return { result: { attributes: Dictionary('UTM_X',G.x,'UTM_Y',G.y) } }
}
/*
Note: the code above will update both fields with the changed values if
there are values that have been updated in the field.
*/ That way it will only need to compare the latest changes to the geometry change. If there is a change it will update accordingly.
... View more
10-01-2025
08:53 AM
|
0
|
0
|
750
|
|
IDEA
|
I probably should have looked up the documentation for that before posting this idea. I had explored and played around with Web Editor but failed to properly understand how the form behavior is setup. I typically see the form behavior configured within the application itself, so this workflow caught me off guard. The behavior I was also thinking about is having it setup in such a way that a single arcade expression could dictate the behavior of the entire form rather than modifying the behavior every field input. In regard to the layout of the form itself, it would be nice to be able to configure the field inputs similar to that of PowerApps given that the real estate on various monitors allows for more flexibility. Regarding this workflow then I think this idea ought to be moved to field maps or perhaps split so that the other idea for the layout itself can persist here.
... View more
09-16-2025
08:58 AM
|
0
|
0
|
228
|
|
IDEA
|
Hi @Laura, Have you tried setting the value from Statistic to Feature and have a filter to set to only display inspections on a given date or the current date? From there you can use the advanced option to display specific fields.
... View more
09-15-2025
01:06 PM
|
0
|
0
|
256
|
|
IDEA
|
I believe the capability may already exist if you know how to setup the calculation/attribute rule.
... View more
09-15-2025
12:07 PM
|
0
|
0
|
77
|
|
IDEA
|
Hi @Yanin, One of my recommendations, and one that we are currently using, is instead to create a field with the data type set to Double and set the number of decimal places to 0. This will also bypass the need to consistently change the data type in the database if you are using numbers of a larger size. Numerical datatypes will behave the same regardless of the specific type.
... View more
09-15-2025
12:04 PM
|
0
|
0
|
246
|
|
IDEA
|
For some reason it seems to always get skipped over or is incorporated as part of a future release is the smart capabilities of fields. Currently, the smart editor in Web App Builder allows for certain fields to display/toggle editability based on a filter criteria. This capability, in regards to displaying fields, exists in Survey123 and Field Maps Forms. It would be a huge improvement if the ability to intelligently set certain fields to display/toggle editing, either using a SQL expression or Arcade to modify the attribute form behavior. You could also have it set so that there is a single arcade expression that can dictate the form behavior for its entirety. In addition to that the ability to modify the layout of the attribute form would also be a huge improvement. Modifications such as side by side field, window width, etc.
... View more
09-15-2025
11:53 AM
|
1
|
3
|
295
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 1 | Wednesday | |
| 1 | a week ago | |
| 1 | a week ago | |
| 2 | 2 weeks ago |
| Online Status |
Online
|
| Date Last Visited |
2 hours ago
|