Smart Editor Widget - Summing two fields to display result in another field

08-13-2020 11:24 PM
Esri Contributor

Is it possible to set up smart editor to sum the value of two fields and display it in another field?

For example I want to add the field 1B and 2B, with the result of that appearing in "Potential Yield Total"

I am not sure if this can be done, if it requires custom coding do let me know the best way I could get started to explore more.

Tags (2)
0 Kudos
4 Replies
MVP Regular Contributor

Praneet Castelino

This should be possible without coding using Attribute Rules

 Introduction to attribute rules—ArcGIS Pro | Documentation 

I know it is also possible with some coding if you are using WAB developer edition. 

Esri Contributor

Thank you Rickey, this has pointed me to the right direction.

0 Kudos
Esri Regular Contributor

Hi Praneet Castelino‌,

I'm not sure what your complete workflow is, but I'd like to add to Rickey's comment above.

There is also an option to set up an Arcade expression to generate the sum for these fields. Here is a blog on this topic: Create Custom Field Calculations Using Arcade Expressions 

Here's an example:

1. Calculate the field:

2. Get results:

BUT, when using the field calculation from the layer's Data tab, values are calculated and written into the field but won't be generated on the fly as new features are added.

You will need to trigger the field calculation again to update the values. You can find a way to automate this process. Maybe there is a way to automate something like this with ArcGIS Notebooks? ArcGIS Notebooks  -- this needs more investigating.

If you need these values generated on the fly as new features are created, you can also create an arcade expression in the layer pop-up in the web map.

The downside of this option is that the values are not "written into" the target field and will only be reflected in the pop-up in this web map.

So depending on if you are working in ArcGIS or Portal, and if you need these values hardcoded into your field, you can explore these options. 

Esri Contributor

Thank you Alix, this is quite interesting and I am learning a lot.

I will definitely be doing more research on this. I am quite new to the whole ArcGIS ecosystem and trying to get my head around things as I work through a project.