<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Attribute Assistant - Expressions: Why am I getting a Type mismatch error with IFF? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/attribute-assistant-expressions-why-am-i-getting-a/m-p/235569#M1466</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attribute Assistant - Expressions:&amp;nbsp; I am getting an error with my IFF expression that I cannot figure out how to resolve.&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;Version 3.1.17 of the Attribute Assistant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my configuration values:&lt;/P&gt;&lt;TABLE height="81" width="732"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 110.8px;"&gt;TABLENAME&lt;/TD&gt;&lt;TD style="width: 107.067px;"&gt;FIELDNAME&lt;/TD&gt;&lt;TD style="width: 140.133px;"&gt;VALUEMETHOD&lt;/TD&gt;&lt;TD style="width: 347.067px;"&gt;VALUEINFO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 110.8px;"&gt;Building&lt;/TD&gt;&lt;TD style="width: 107.067px;"&gt;CityVillage&lt;/TD&gt;&lt;TD style="width: 140.133px;"&gt;EXPRESSION&lt;/TD&gt;&lt;TD style="width: 347.067px;"&gt;IFF(isNull([CityVillage]), [Township], [CityVillage])&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error log:&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Row Info&lt;BR /&gt; Row Number 29&lt;BR /&gt; TableName: Building&lt;BR /&gt; FieldName: CityVillage&lt;BR /&gt; ValueInfo: IFF(isNull([CityVillage]), [Township], [CityVillage])&lt;BR /&gt; ValueMethod: EXPRESSION&lt;BR /&gt; On Create: 1&lt;BR /&gt; On Change: 1&lt;/P&gt;&lt;P&gt;Checking for Subtype Restriction&lt;BR /&gt; Field Name: City Village was found at index: 20&lt;BR /&gt; Trying: EXPRESSION&lt;BR /&gt; replace field: Township with a value&lt;BR /&gt; replace field: CityVillage with a value&lt;BR /&gt; replace field: CityVillage with a value&lt;BR /&gt; Checking to verify there is a field to store the expression&lt;BR /&gt;Expression to be eval: IFF(True, "OAKLAND", "")&lt;BR /&gt; ERROR: evaluating the expression for feature in Building with OID of 15859&lt;BR /&gt; System.Runtime.InteropServices.COMException (0x800A000D): Type mismatch: 'IFF'&lt;BR /&gt; at MSScriptControl.ScriptControlClass.&lt;BR /&gt; at ArcGIS4LocalGovernment.AttributeAssistantEditorExtension.SetDynamicValues(IObject inObject, String mode, List`1&amp;amp; ChangeFeatureList, List`1&amp;amp; NewFeatureList, List`1&amp;amp; ChangeFeatureGeoList) in C:\Projects\GitHub\local-government-desktop-addins\Attribute Assistant Add In\AttributeAssistantAddIn\AttributeAssistantEditorExtension.cs:line 12514&lt;BR /&gt; Finished: EXPRESSION&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;SPAN&gt;IFF(isNull([CityVillage]), [Township], "&amp;lt;NULL&amp;gt;").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I even downloaded the AA source code and traced through it to see why it was failing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It fails on the following line of code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="30" src="https://community.esri.com/legacyfs/online/421655_pastedImage_1.png" width="296" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking at what the string newValue has stored prior to the above call is IFF(True, \"Oakland\", \"\")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have look at other posts, but haven't found anything that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know what could be causing this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2018 19:58:32 GMT</pubDate>
    <dc:creator>JeremiahMartin</dc:creator>
    <dc:date>2018-09-11T19:58:32Z</dc:date>
    <item>
      <title>Attribute Assistant - Expressions: Why am I getting a Type mismatch error with IFF?</title>
      <link>https://community.esri.com/t5/developers-questions/attribute-assistant-expressions-why-am-i-getting-a/m-p/235569#M1466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attribute Assistant - Expressions:&amp;nbsp; I am getting an error with my IFF expression that I cannot figure out how to resolve.&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;Version 3.1.17 of the Attribute Assistant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my configuration values:&lt;/P&gt;&lt;TABLE height="81" width="732"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 110.8px;"&gt;TABLENAME&lt;/TD&gt;&lt;TD style="width: 107.067px;"&gt;FIELDNAME&lt;/TD&gt;&lt;TD style="width: 140.133px;"&gt;VALUEMETHOD&lt;/TD&gt;&lt;TD style="width: 347.067px;"&gt;VALUEINFO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 110.8px;"&gt;Building&lt;/TD&gt;&lt;TD style="width: 107.067px;"&gt;CityVillage&lt;/TD&gt;&lt;TD style="width: 140.133px;"&gt;EXPRESSION&lt;/TD&gt;&lt;TD style="width: 347.067px;"&gt;IFF(isNull([CityVillage]), [Township], [CityVillage])&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error log:&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Row Info&lt;BR /&gt; Row Number 29&lt;BR /&gt; TableName: Building&lt;BR /&gt; FieldName: CityVillage&lt;BR /&gt; ValueInfo: IFF(isNull([CityVillage]), [Township], [CityVillage])&lt;BR /&gt; ValueMethod: EXPRESSION&lt;BR /&gt; On Create: 1&lt;BR /&gt; On Change: 1&lt;/P&gt;&lt;P&gt;Checking for Subtype Restriction&lt;BR /&gt; Field Name: City Village was found at index: 20&lt;BR /&gt; Trying: EXPRESSION&lt;BR /&gt; replace field: Township with a value&lt;BR /&gt; replace field: CityVillage with a value&lt;BR /&gt; replace field: CityVillage with a value&lt;BR /&gt; Checking to verify there is a field to store the expression&lt;BR /&gt;Expression to be eval: IFF(True, "OAKLAND", "")&lt;BR /&gt; ERROR: evaluating the expression for feature in Building with OID of 15859&lt;BR /&gt; System.Runtime.InteropServices.COMException (0x800A000D): Type mismatch: 'IFF'&lt;BR /&gt; at MSScriptControl.ScriptControlClass.&lt;BR /&gt; at ArcGIS4LocalGovernment.AttributeAssistantEditorExtension.SetDynamicValues(IObject inObject, String mode, List`1&amp;amp; ChangeFeatureList, List`1&amp;amp; NewFeatureList, List`1&amp;amp; ChangeFeatureGeoList) in C:\Projects\GitHub\local-government-desktop-addins\Attribute Assistant Add In\AttributeAssistantAddIn\AttributeAssistantEditorExtension.cs:line 12514&lt;BR /&gt; Finished: EXPRESSION&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;SPAN&gt;IFF(isNull([CityVillage]), [Township], "&amp;lt;NULL&amp;gt;").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I even downloaded the AA source code and traced through it to see why it was failing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It fails on the following line of code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="30" src="https://community.esri.com/legacyfs/online/421655_pastedImage_1.png" width="296" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking at what the string newValue has stored prior to the above call is IFF(True, \"Oakland\", \"\")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have look at other posts, but haven't found anything that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know what could be causing this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 19:58:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/attribute-assistant-expressions-why-am-i-getting-a/m-p/235569#M1466</guid>
      <dc:creator>JeremiahMartin</dc:creator>
      <dc:date>2018-09-11T19:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Assistant - Expressions: Why am I getting a Type mismatch error with IFF?</title>
      <link>https://community.esri.com/t5/developers-questions/attribute-assistant-expressions-why-am-i-getting-a/m-p/235570#M1467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is resolved now.&amp;nbsp; I didn't catch that I had typed IFF instead of IIF.&lt;/P&gt;&lt;P&gt;Thanks to &lt;A href="https://community.esri.com/migrated-users/25908"&gt;Michael Miller&lt;/A&gt;‌!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2018 20:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/attribute-assistant-expressions-why-am-i-getting-a/m-p/235570#M1467</guid>
      <dc:creator>JeremiahMartin</dc:creator>
      <dc:date>2018-09-11T20:58:15Z</dc:date>
    </item>
  </channel>
</rss>

