AnsweredAssumed Answered

Attribute Assistant - Expressions: Why am I getting a Type mismatch error with IFF?

Question asked by miahmartin on Sep 11, 2018
Latest reply on Sep 11, 2018 by miahmartin

Attribute Assistant - Expressions:  I am getting an error with my IFF expression that I cannot figure out how to resolve.

I am using Version 3.1.17 of the Attribute Assistant.


Here is my configuration values:

BuildingCityVillageEXPRESSIONIFF(isNull([CityVillage]), [Township], [CityVillage])


Here is the error log:


Row Info
Row Number 29
TableName: Building
FieldName: CityVillage
ValueInfo: IFF(isNull([CityVillage]), [Township], [CityVillage])
On Create: 1
On Change: 1

Checking for Subtype Restriction
Field Name: City Village was found at index: 20
replace field: Township with a value
replace field: CityVillage with a value
replace field: CityVillage with a value
Checking to verify there is a field to store the expression
Expression to be eval: IFF(True, "OAKLAND", "")
ERROR: evaluating the expression for feature in Building with OID of 15859
System.Runtime.InteropServices.COMException (0x800A000D): Type mismatch: 'IFF'
at MSScriptControl.ScriptControlClass.
at ArcGIS4LocalGovernment.AttributeAssistantEditorExtension.SetDynamicValues(IObject inObject, String mode, List`1& ChangeFeatureList, List`1& NewFeatureList, List`1& ChangeFeatureGeoList) in C:\Projects\GitHub\local-government-desktop-addins\Attribute Assistant Add In\AttributeAssistantAddIn\AttributeAssistantEditorExtension.cs:line 12514


The goal is to copy the Township value to the CityVillage field if the CityVillage is null and do nothing if it isn't null. I have tried to use the following expression, but get the same error: IFF(isNull([CityVillage]), [Township], "<NULL>").


I even downloaded the AA source code and traced through it to see why it was failing.


It fails on the following line of code:


Looking at what the string newValue has stored prior to the above call is IFF(True, \"Oakland\", \"\")


I have look at other posts, but haven't found anything that helped.



Does anyone know what could be causing this?