<?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: Wildcard in FIELD NAME (Model Builder) in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/wildcard-in-field-name-model-builder/m-p/468664#M15722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Solution: Using the Calculate Value Tool with a Python statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;field()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def field():
&amp;nbsp; ColName = []
&amp;nbsp; CName = arcpy.ListFields("&amp;lt;pathtofolder&amp;gt;/%name%_id.shp", "FID_"+ "%name%"+ "_f*")
&amp;nbsp; ColName.insert(0, CName[0].name)
&amp;nbsp; return fieldName
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Data Type:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then use the calculated Output Value as input for the next tool (e.g. Join Field)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using a where clause for the Select tool e.g.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; field() &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def field():
&amp;nbsp; ColName = []
&amp;nbsp; CName = arcpy.ListFields("&amp;lt;pathtofolder&amp;gt;/%name%_id.shp", "FID_"+ "%name%"+ "_s*")
&amp;nbsp; ColName.insert(0, CName[0].name)
&amp;nbsp; where_clause = ColName[0] +' &amp;gt; -1'
&amp;nbsp; return where_clause
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Data Type:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output value can then be used as input for the Expression of the Select Tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:46:41 GMT</pubDate>
    <dc:creator>KathrinSchulte-Braucks</dc:creator>
    <dc:date>2021-12-11T20:46:41Z</dc:date>
    <item>
      <title>Wildcard in FIELD NAME (Model Builder)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/wildcard-in-field-name-model-builder/m-p/468663#M15721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got the following issue to address:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I process a bunch of shapefiles with a certain name stored in a folder. I use the %name% variable to name the outputs of geoprocessing operations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I want to use an SQL statement for a Selection (Select Tool). I don't now the exact fieldname, because the field is produced during a geoprocessing task executed before (Identity). The name is something like "FID_" +[shapefilename]+ [s+further characters], but not exactly known. So I'd like to make a query such as: "FID"+%name% + "s*" &amp;gt; -1 . My thought is to pass a variable containing the expression needed for the Select Tool. So far it is possible to pass a string variable such as "FID_%name%" , but the s* Wildcard is not accepted as SQL syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clues?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tank you very much for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kathrin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 09:02:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/wildcard-in-field-name-model-builder/m-p/468663#M15721</guid>
      <dc:creator>KathrinSchulte-Braucks</dc:creator>
      <dc:date>2014-05-14T09:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard in FIELD NAME (Model Builder)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/wildcard-in-field-name-model-builder/m-p/468664#M15722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Solution: Using the Calculate Value Tool with a Python statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;field()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def field():
&amp;nbsp; ColName = []
&amp;nbsp; CName = arcpy.ListFields("&amp;lt;pathtofolder&amp;gt;/%name%_id.shp", "FID_"+ "%name%"+ "_f*")
&amp;nbsp; ColName.insert(0, CName[0].name)
&amp;nbsp; return fieldName
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Data Type:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then use the calculated Output Value as input for the next tool (e.g. Join Field)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using a where clause for the Select tool e.g.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; field() &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def field():
&amp;nbsp; ColName = []
&amp;nbsp; CName = arcpy.ListFields("&amp;lt;pathtofolder&amp;gt;/%name%_id.shp", "FID_"+ "%name%"+ "_s*")
&amp;nbsp; ColName.insert(0, CName[0].name)
&amp;nbsp; where_clause = ColName[0] +' &amp;gt; -1'
&amp;nbsp; return where_clause
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Data Type:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output value can then be used as input for the Expression of the Select Tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/wildcard-in-field-name-model-builder/m-p/468664#M15722</guid>
      <dc:creator>KathrinSchulte-Braucks</dc:creator>
      <dc:date>2021-12-11T20:46:41Z</dc:date>
    </item>
  </channel>
</rss>

