I need to run a Calculate on a field in a hosted feature layer

2098
2
Jump to solution
06-29-2016 10:43 AM
AllanLambert
New Contributor III

CalcGrid.gifI have a Damage Assessment feature layer hosted on AGOL with a web map.   Along with Domain controlled fields are Estimated % of Damage, Estimated $ Amt of Damage and a prepopulated Dwelling Value field.  Field type is Double on these 3 fields. 50k points filtered down to only those edited with Est % Damage. I need to either

1.  Calc (Est $ Damage = DwellingVal * Est % Damage) on the fly as the user enters data for each point.

2.  Create a URL to Calc (Est $ Damage = DwellingVal * Est % Damage) where (Est % Damage is >0).  AGOL times out    calc-ing the 50k records so I think the Where clause is necessary to only capture the 500 or 5000 that are damaged.

3.  I'm open to ANY suggestion!  Thanks. Allan

I can't get the REST API grid to work. The error says that the calcexpression is invalid and Object reference not set....:

Where: PercentDamage > 0

"calcExpression":[{"field" : "EstDollarDamage", "sqlExpression" : "DwellingVal*PercentDamage*.01"}]

http://services5.arcgis.com/cA4ofagPaJJ7qhEz/arcgis/rest/services/DamageAssessment_O_only/FeatureSer... > 10 2”,calcExpression={“field”: “EstDollarDamage”,“sqlexpression” : "DwellingVal*PercentDamage*.01"})

0 Kudos
1 Solution

Accepted Solutions
RandyBurton
MVP Alum

Since you are using an HTML form for the calculation, you do not need to put "calcExpression:" in the box.

Just put the portion between the square brackets in the box (including the square brackets). This would go in the box:

[{"field" : "EstDollarDamage", "sqlExpression" : "DwellingVal*PercentDamage*.01"}]

View solution in original post

2 Replies
RandyBurton
MVP Alum

Since you are using an HTML form for the calculation, you do not need to put "calcExpression:" in the box.

Just put the portion between the square brackets in the box (including the square brackets). This would go in the box:

[{"field" : "EstDollarDamage", "sqlExpression" : "DwellingVal*PercentDamage*.01"}]

AllanLambert
New Contributor III

Worked. Thanks very much!!

0 Kudos