<?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 Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101671#M549</link>
    <description>&lt;P&gt;I do not understand well I think - how could you select on a field that is in another table? Maybe you want to add a join so both fields are available in a joined table?&lt;/P&gt;&lt;P&gt;If the second field may or may not be there in the table you are selecting you could use preconditions to choose which select expression to use (one with the field, one without) but it's not clear to me that is your issue.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Sep 2021 15:41:10 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-09-24T15:41:10Z</dc:date>
    <item>
      <title>Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101105#M548</link>
      <description>&lt;P&gt;Hi! Im using ArcMap 10.x in ModelBuilder working with Electrical linear segments and calculating attributes: Overhead (OH) Primary lines and Underground (UG) primary lines. OH primary has field name: conductorMaterial, and the UG primary has the equivalent field name titled: neutralMaterial.&amp;nbsp;&lt;BR /&gt;I’m looking to have one statement that captures both fields attributes and use the THEN to = my combinedMaterial field.&lt;BR /&gt;i.e., If [conductorMaterial = “aluminum” Or [neutralMaterial] = “aluminum” Then&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;combinedMaterial = “ACSR Cables”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since conductorMaterial only exists in one attribute table and neutralMaterial exists in the other, I get an error because one field doesn’t exist for the expression. I could potentially create a new field and add more steps than I’d like but is there a way for a calculation to run even though a field may not be present? &amp;nbsp;I really hope that was clear. Thank ya for checking!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 02:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101105#M548</guid>
      <dc:creator>jhomme981</dc:creator>
      <dc:date>2021-09-23T02:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101671#M549</link>
      <description>&lt;P&gt;I do not understand well I think - how could you select on a field that is in another table? Maybe you want to add a join so both fields are available in a joined table?&lt;/P&gt;&lt;P&gt;If the second field may or may not be there in the table you are selecting you could use preconditions to choose which select expression to use (one with the field, one without) but it's not clear to me that is your issue.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 15:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101671#M549</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-09-24T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101690#M550</link>
      <description>&lt;P&gt;Thank you for the response. I think we are tracking, and the join would be an option, but the OH or UG occur with many site locations and I was hoping to not have to run a join for every instance (site). It sounds like the join is the way it would have to be however.&amp;nbsp; My thought was, could I write a statement that would acknowledge one field or the other field (since only one or the other will be present each time) and then be able to disregard the field that is not present but capture the field that is present. Basically, a generic statement that works for either instance.&amp;nbsp; I'm sorry for the lack of clarity! Many thanks again for your time!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 16:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101690#M550</guid>
      <dc:creator>jhomme981</dc:creator>
      <dc:date>2021-09-24T16:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101693#M551</link>
      <description>&lt;P&gt;In ArcMap, the precondition route (no "If" tool as we have in Pro ModelBuilder) would be more complicated, so it may make more sense to build your select expression in Python using the Calculate Value tool with logic based on what fields are there, and pass that SQL expression to the select by attributes tool.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 22:57:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101693#M551</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-09-24T22:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101734#M552</link>
      <description>&lt;P&gt;I gotcha and that's what I was thinking/hoping to avoid since my python knowledge is pretty limited at this point. Thank you for identifying the problem/solution more specifically! I will now try heading into uncharted waters (for me, anyway)&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp; &amp;nbsp;Thank you very much!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 17:31:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101734#M552</guid>
      <dc:creator>jhomme981</dc:creator>
      <dc:date>2021-09-24T17:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101841#M554</link>
      <description>&lt;P&gt;Here's a solution that may work for you:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ModelBuilder fmodel" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23856i8633DEE9A205FB53/image-size/large?v=v2&amp;amp;px=999" role="button" title="expr.jpg" alt="ModelBuilder fmodel" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ModelBuilder fmodel&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and my Calculate Value code to build your SQL expression to select the rows you want to calculate:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Calculate Value expression
make_expr(r"%input table%")

# code block
# returns either "CONDUCTORMATERIAL = 'aluminum' or 
#                "NEUTRALMATERIAL = 'aluminum'
def make_expr(tbl):
    f1 = "conductorMaterial".upper()
    f2 = "neutralMaterial".upper()
    fld_list = [f.name.upper() for f in arcpy.ListFields(tbl)] 
    if f1 in fld_list:
        fld = f1
    else:
        fld = f2
    expr = "{} = \'aluminum\'".format(fld)
    return expr&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Sep 2021 21:41:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101841#M554</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-09-24T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Similar but separate Feature classes with differing field names | If Then , OR  won’t recognize one field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101952#M555</link>
      <description>&lt;P&gt;Greetings&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325" target="_self"&gt;&lt;SPAN class=""&gt;curtvprice&lt;/SPAN&gt;&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;Thanks!! I was able to dissect the logic and instruction you provided and now have a much better understanding! The calculation works and is waaay simpler than the road I was going down. Thank you again!&lt;/P&gt;&lt;P&gt;V/r,&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 15:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/similar-but-separate-feature-classes-with/m-p/1101952#M555</guid>
      <dc:creator>jhomme981</dc:creator>
      <dc:date>2021-09-26T15:51:43Z</dc:date>
    </item>
  </channel>
</rss>

