<?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 How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1333630#M73575</link>
    <description>&lt;P&gt;Working to create a script which iterates over a set of CSV files and then joins to a ZIP file. One that is completed, it goes through to Select by Attribute to ensure we are looking only true values and not null.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnDavidson_0-1695943002754.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81965iC6B68F72161E1442/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnDavidson_0-1695943002754.png" alt="JohnDavidson_0-1695943002754.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have the model written and it works well on the first pass, but when it comes to the next file it fails because the Select Layer by Attribute is looking for the previous filename. How can I pass the filename as a variable? Is this possible?&lt;/P&gt;&lt;P&gt;I have referenced the below article without any luck in having it work either.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/modelbuilder/inline-variable-substitution.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/modelbuilder/inline-variable-substitution.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Any help to get this working would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 23:23:49 GMT</pubDate>
    <dc:creator>JohnDavidson</dc:creator>
    <dc:date>2023-09-28T23:23:49Z</dc:date>
    <item>
      <title>How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1333630#M73575</link>
      <description>&lt;P&gt;Working to create a script which iterates over a set of CSV files and then joins to a ZIP file. One that is completed, it goes through to Select by Attribute to ensure we are looking only true values and not null.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnDavidson_0-1695943002754.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81965iC6B68F72161E1442/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnDavidson_0-1695943002754.png" alt="JohnDavidson_0-1695943002754.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have the model written and it works well on the first pass, but when it comes to the next file it fails because the Select Layer by Attribute is looking for the previous filename. How can I pass the filename as a variable? Is this possible?&lt;/P&gt;&lt;P&gt;I have referenced the below article without any luck in having it work either.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/modelbuilder/inline-variable-substitution.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/modelbuilder/inline-variable-substitution.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Any help to get this working would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 23:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1333630#M73575</guid>
      <dc:creator>JohnDavidson</dc:creator>
      <dc:date>2023-09-28T23:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1333868#M73590</link>
      <description>&lt;DIV class=""&gt;&lt;P&gt;I am not sure why I didn't think of this sooner. So I was able to get the %Variable% working as it should, but then I couldn't get the second half working such as '.csv.REV_SUB_TOTAL'&lt;/P&gt;&lt;P&gt;I added it as its own Variable called %String% and then changed my SQL statement to %Name%%String% IS NOT NULL and it worked!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Sep 2023 19:18:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1333868#M73590</guid>
      <dc:creator>JohnDavidson</dc:creator>
      <dc:date>2023-09-29T19:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1514310#M86387</link>
      <description>&lt;P&gt;I'm using a ModelBuilder to select Multiple values from a layer and it is not working. It only works when I select a single value. What am I doing wrong please.&lt;/P&gt;&lt;P&gt;Model:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_5-1722620330495.png" style="width: 272px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111495i05262FC43C51606D/image-dimensions/272x218?v=v2" width="272" height="218" role="button" title="AbiDhakal_5-1722620330495.png" alt="AbiDhakal_5-1722620330495.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Select Layer By Attribute expression window:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_4-1722620282794.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111494iA4BC0540D3E8D065/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AbiDhakal_4-1722620282794.png" alt="AbiDhakal_4-1722620282794.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Parameter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_6-1722620375850.png" style="width: 619px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111496iA6134E0DA80453D1/image-dimensions/619x249?v=v2" width="619" height="249" role="button" title="AbiDhakal_6-1722620375850.png" alt="AbiDhakal_6-1722620375850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Geoprocessing:&lt;BR /&gt;In the window below marked in red, if I only put one value (SPB) then it will select, however if I put multiple values (SPB, EAB, etc.) as shown below it will not select.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_2-1722620170964.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111491i3B53D7FD81D50B8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AbiDhakal_2-1722620170964.png" alt="AbiDhakal_2-1722620170964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've added a variable to the model that would allow me to put Multiple values.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_3-1722620171043.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111493i905B732B7FC78190/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AbiDhakal_3-1722620171043.png" alt="AbiDhakal_3-1722620171043.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please help me.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Abi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 17:42:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1514310#M86387</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2024-08-02T17:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1649302#M98829</link>
      <description>&lt;P&gt;Hi Abi, were you able to figure this out? I'm trying to do something similar and running into the same issue.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 10:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1649302#M98829</guid>
      <dc:creator>SM13</dc:creator>
      <dc:date>2025-09-10T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can you pass a variable to a SQL Expression for a Select by Attribute in Modelbuilder</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1651522#M99038</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/935498"&gt;@SM13&lt;/a&gt;&amp;nbsp;- Unfortunately not. Esri has to debug the model/tool so multiple parameters with single or multiple values work. This is a simple tool and ask, but Esri seems to overlook it. I'm still waiting to hear for the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 16:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-you-pass-a-variable-to-a-sql-expression/m-p/1651522#M99038</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2025-09-18T16:13:19Z</dc:date>
    </item>
  </channel>
</rss>

