I'm using the calculate field tool in model builder & need to use an IF formula in the expressions box.
So far the code looks like this which doesn't work
if (RouteType) = 'Parental Assistance';
Return $feature.ParentalAllowanceMiles;
Else return
$feature.RouteOutwardDistance + $feature.RouteInwardDistance
I need the Field Daily Mileage to recognise if the record has the Route Type of 'Parental Assistance' & then return a the value in that field so no calculation required. But for every other 'Route Type' the original calculation of adding 2 fields together needs to remain.
Solved! Go to Solution.
if($feature.RouteType == 'Parental Assistance') {
return $feature.ParentalAllowanceMiles
}
return $feature.RouteOutwardDistance + $feature.RouteInwardDistance
https://developers.arcgis.com/arcade/guide/operators/
https://developers.arcgis.com/arcade/guide/logic/
if($feature.RouteType == 'Parental Assistance') {
return $feature.ParentalAllowanceMiles
}
return $feature.RouteOutwardDistance + $feature.RouteInwardDistance
https://developers.arcgis.com/arcade/guide/operators/
https://developers.arcgis.com/arcade/guide/logic/
Thanks that worked 🙂