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
Wednesday
|
0
|
0
|
166
|
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
3 weeks ago
|
0
|
0
|
76
|
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
3 weeks ago
|
0
|
0
|
169
|
IDEA
|
I believe the capability may already exist if you know how to setup the calculation/attribute rule.
... View more
3 weeks ago
|
0
|
0
|
27
|
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
3 weeks ago
|
0
|
0
|
66
|
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
3 weeks ago
|
1
|
3
|
143
|
POST
|
If this is a bug then feel free to report it to Esri or post the issue. It also depends if the version of field maps is enterprise vs agol where the agol is more up to date.
... View more
a month ago
|
0
|
1
|
448
|
POST
|
Hi @JoseSanchez, Are you referring to using geofences, if so, then there are workflows that incorporate arcade and the creation of geometries to use as geofences when editing. You can also change the settings in field maps to collect at the current location.
... View more
a month ago
|
0
|
9
|
538
|
POST
|
As someone who also does SQL querying in SQL server you can rename a shape field to any name you want in SQL. As to why the default is what it is nobody truly knows. My only thoughts are that it is the variation in database types since SQL has mulitple variants such as PostgreSQL, MySQL, OracleSQL, and SQL Server. I think geodatabases are a stem of what are considered Microsoft Access Databases but are created to have local shapefields. As @CalvinHarmin pointed out, using the SHAPE@ should be used in python since I believe it is catchall regarding any shape field.
... View more
08-28-2025
07:46 AM
|
0
|
0
|
320
|
POST
|
Like @George_Thompson said, those names cannot be renamed. However, when it comes to using any programming language, you can create a dictionary of mapped field names. For example ( { Shape_Area: ST_AREA } ) so when you change data sources you can get the equivalent field that you need and vice versa.
... View more
08-27-2025
04:22 AM
|
0
|
0
|
436
|
POST
|
Here is what I came up with but without having any sample data it is the best that I could do. This is just a suggestive means but feel free to modify and ask any further questions. function RoundN(val){ iif( TypeOf(Number(val))=='Number', Round(Number(val)), 0 ) }
function Risk(n){ iif( Number(n)>0, Round(n/10)*10, 0 ) }
function ordinal(n) {
var r = n % 10
var t = When( r==1, "st", r==2, "nd", r==3, "rd", "th" )
iif( !IsEmpty(n), Concatenate(n,t), null )
}
// Set the default values
var RootFieldNames = [
"TEETHLOST","ARTHRITIS","CANCER","COPD",
"CHD","CASTHMA","DEPRESSION","DIABETES",
"BPHIGH","HIGHCHOL","OBESITY","STROKE"
]
// Set the coomon names for all fields
var RootName = 'CDC_PLACES_2175'
var percName = '_percentile'
var popName = '_EstPop'
// Creates a new line
var nl = TextfFormatting.NewLine
/* Get all attributes in the feature
Loop through and populate the dictionary */
Expects($feature,'*')
var Values = {}
for( var i in $feature ){ Values[i] = $feature[i] }
/* Another option
Expects($feature)
var Values = Dictionary($feature).attributes */
/* Create the dictionaries to be populated
using the information gathered below */
var Convert = {}
var PopVals = {}
var PCTVals = {}
for( var r in RootFieldNames ){
r = RootFieldNames[r]
var pctname = RootName + '.' + r + PercFName
var popname = r+PopFName
//Get the field name and round if the field is in the
if( HasKey(pctname,Values) ){ PCTVals[r] = RoundN(Values[pctname]) }
else if( HasKey(popname,Values) ){ PopVals[r] = PCTVals[r] = Values[popname] }
//Populate the conversion dictionary with the default values
Convert[r] = When(
r=="TEETHLOST","All teeth lost",
r=="CANCER","Cancer (non-skin) or melanoma",
r=="CHD","Coronary heart disease",
r=="CASTHMA","Coronary heart disease",
r=="CHD","Current asthma",
Includes(["ARTHRITIS","DEPRESSION","DIABETES","OBESITY","STROKE"],r),Proper(r),
r=="BPHIGH","High blood pressure",
r=="HIGHCHOL","High cholesterol",
r=="COPD", r,
null
)
}
// Set the score and limit dictionary
var Limits = { VeryHigh:[], High:[], Medium:[] }
var PctScores = { VeryHigh:[], High:[], Medium:[] }
// Loop through all keys in the conversion dictionary
for( var i in Convert ){
var pop = PopVals[i]
var pct = PCTVals[i]
// Set value dictionary with the default value
var Def = { label: Convert[i], score: pct, estPop: pop }
// Get the rating of the measured risk percentage
var R = When( Risk(pct)==90, 'VeryHigh', Risk(pct)==80, 'High', Risk(pct)==70, 'Medium', Null )
/* If the rating is a key value in the limit dictionary
then populate both the limit dictionary with the
default value and the percentage score array with the
percentages */
if( HasKey(Limits,R) ){
Push( Limits[R], Def )
Push( PctScores[R], pct )
}
}
// Set the html array
var HTMLText = []
// Loop through the limit dictionary
for( var l in Limits ){
var vals = Limits[l]
if( Count(vals) > 0 ){
// Get the score array and sort from highest to lowest of distinct values
var valscores = Reverse( Sort( Distinct( PctScores[l] ) ) )
// Set the html text
var html = "<b>"+l+" (" + Count(vals) + "):</b>"+nl
/* Set the empty paragraph html array
Loop through the array of score values and
reassign the index as the value */
var pHTML = []
for( var i in valscores ){
i = valscores[i]
// Loop through the array of score values and reassign the index as the value
for( var v in vals ){
v = vals[v]
/* If the score matches the value
update the paragraph html array with the text
erase the value from the array
break the loop */
if( v.score == i ){
var Text = '<p>style="text-indent:15%">' + Proper(v.label) + " (" + ordinal(v.score) + " Percentile and Est Pop: " + v.estPop + ")</p>"
Push( pHTML, Text )
Erase(vals,v)
break
}
}
}
/* If the count of the array below is greater than 0
then conatenate the list of values and insert a new line */
if( Count( pHTML ) > 0 ){
pHTML = Concatenate(pHTML,nl)
Push(HTMLText, html+pHTML)
}
}
else{ Console('There were no risks in this catergory') }
}
/* Return the concatenated html if the count of the html list
is greater than 0, otherwise return the default text */
iif( Count(HTMLText) > 0, Concatenate(HTMLText,nl), "No conditions at Medium or above" )
... View more
08-21-2025
10:55 AM
|
1
|
0
|
229
|
POST
|
There are also, in addition to what @HaydenWelch mentioned, there are a few ways in which your code can be rewritten to be simpler. Utilize the When function when there are multiple if-if else statements. The when function behaves in a similar manner and ultimately returns the same thing. You can specify the default value as null to basically do nothing if none of the when conditions are met. When there are multiple values being made but logically are the same then it is best to create a dictionary of those values rather than resulting to multiple statements. You can also use the example below in conjunction with Expects. Expects($feature)
var Values = {}
for( var i in $feature ){ Values[i] = $feature[i] }
/* Another option
Expects($feature)
var Values = Dictionary($feature).attributes
*/ Just for fun I am trying to rewrite your code for suggestive purposes.
... View more
08-20-2025
09:11 AM
|
1
|
1
|
289
|
POST
|
Actually if you pull up the attributes rather than the tables themselves then you will see the related records, both forward and backward.
... View more
08-19-2025
04:20 AM
|
1
|
0
|
293
|
POST
|
I just checked a little while ago and I am testing your method. I have never used this method before but I will give an update when things start to go in the direction that we are striving for. Thank you very much for that needed information.
... View more
08-18-2025
07:51 AM
|
0
|
0
|
419
|
POST
|
Does your method work in a 10.9.1 portal? I am testing it out now to see but we are unfortunately limited until we can upgrade.
... View more
08-18-2025
07:44 AM
|
0
|
0
|
421
|
Title | Kudos | Posted |
---|---|---|
1 | 3 weeks ago | |
1 | 08-21-2025 10:55 AM | |
1 | 08-20-2025 09:11 AM | |
1 | 08-19-2025 04:20 AM | |
2 | 08-18-2025 05:19 AM |
Online Status |
Offline
|
Date Last Visited |
Thursday
|