Simple Arcade Expressions

304
4
Jump to solution
02-27-2020 04:05 PM
RyanHinesley
New Contributor II

Can you call the results from an arcade expression for use in another expression? This is for collector use.

1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi Ryan Hinesley ,

That makes sense. However, I'm afraid that if you want to have return both the ArcadeChemicalCost and  ArcadeTotalCost, you will have to include the code for ArcadeChemicalCost in the ArcadeTotalCost expression. 

The if else statement can probably be simplified using a dictionary or a when statement.

View solution in original post

4 Replies
XanderBakker
Esri Esteemed Contributor

Hi Ryan Hinesley ,

An arcade expression (when dynamic like in a pop-up) does not have any knowledge of the existence of that any other Arcade expression results. When you execute the expression in a field calculation you generate a physical result and a next Arcade expression can have access to that result. 

Can you provide an example of what you are trying to establish?

RyanHinesley
New Contributor II

I have a field with roughly 15 coded value domains for chemicals a forester can choose for a project. I use an If Else statement to get the cost for the the chemical that's chosen by the forester so that's now a new Arcade in memory field called ArcadeChemicalCost. I also have a rate field where the forester will enter a number. I'd like to have another Arcade expression that calls the Arcade cost and multiplies it by the rate to populate an Arcade total cost. ArcadeChemicalCost * Rate = ArcadeTotalCost. I know I can string a bunch of code together to get the result but I want to avoid writing more code than I have to. I wasn't sure if this functionality exists or not. I hope my gibberish makes sense. Thanks for looking at this.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Ryan Hinesley ,

That makes sense. However, I'm afraid that if you want to have return both the ArcadeChemicalCost and  ArcadeTotalCost, you will have to include the code for ArcadeChemicalCost in the ArcadeTotalCost expression. 

The if else statement can probably be simplified using a dictionary or a when statement.

RyanHinesley
New Contributor II

I was afraid of that but thought I would check just in case. Thanks for the help and quick response!!!