<?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: Select_analysis using custom tool. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424508#M33317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you resolved your initial question.&lt;/P&gt;&lt;P&gt;FYI, in this case, you could typically mark your question as correct or as "assumed answered" so others would know it is resolved. &amp;nbsp;You could then start a new post if needed. &amp;nbsp;This keeps threads from getting too long and/or off topic. However, this is related enough that I think it's ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unfortunately I'm not at my desktop right now, so can't give specifics, but you can populate an input list of fields based on the input of the Layer and have it show a checkbox so the parameter creates a list. (Unless you want the user to know and type the field list, i.e. Think it would be "fields;field2")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ive done something similar, but as mentioned, not where I can look. &amp;nbsp;I'll tag a couple others that might know (if they haven't responded as I am typing this) &lt;A href="https://community.esri.com/people/Dan_Patterson"&gt;Dan_Patterson&lt;/A&gt;‌ &lt;A href="https://community.esri.com/people/curtvprice"&gt;curtvprice&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jun 2017 22:20:59 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2017-06-09T22:20:59Z</dc:date>
    <item>
      <title>Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424503#M33312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create a custom tool so users can provide input for arcpy.Select_analysis(in_feature, out_feature, where_clause).&lt;/P&gt;&lt;P&gt;This is the line I want to change into a form for a &amp;nbsp;custom tool:&lt;/P&gt;&lt;P&gt;arcpy.Select_analysis("C:/Birds/Data/nso.shp", "C:/Birds/Data/active.shp", """"NEST" = 'active'""") #NEST is the attribute table field and active is an attribute.&lt;/P&gt;&lt;P&gt;But I want a custom tool so the user can input there own values.&lt;/P&gt;&lt;P&gt;I can properly code for the in_feature and out_feature variables using arcpy.GetParameterAsText.&lt;/P&gt;&lt;P&gt;I need help with the where_clause.&lt;/P&gt;&lt;P&gt;Here is some of my code:&lt;/P&gt;&lt;P&gt;inFeature = arcpy.GetParameterAsText (0) #variable for user to input feature&lt;BR /&gt;OutFeature = arcpy.GetParameterAsText(1) # variable for the output feature&lt;/P&gt;&lt;P&gt;FieldForSelect = arcpy.GetParameterAsText(5) #user inputs field in attribute table to select features&lt;/P&gt;&lt;P&gt;AttributeForSelect = arcpy.GetParameterAsText(6) #user inputs attribute to select for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would the code be&lt;/P&gt;&lt;P&gt;ActiveNest = arcpy.Select_analysis(inFeature, OutFeature, """"FieldForSelect" = 'AttributeForSelect'""") ?&lt;/P&gt;&lt;P&gt;My second question is what is the data type for FieldForSelect (Is it Field?)?This is a field in the attribute table.&lt;/P&gt;&lt;P&gt;And what is the data type for the actual attribute AttributeForSelect (Is it String?)? I think it is string since the attribute is a word/string.&lt;/P&gt;&lt;P&gt;From my example the field is NEST and I am selecting for "active".&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2017 21:02:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424503#M33312</guid>
      <dc:creator>StephanieHoutman</dc:creator>
      <dc:date>2017-06-08T21:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424504#M33313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 10.5pt;"&gt;&lt;SPAN style="color: #3d3d3d; background: white;"&gt;Hi Stephanie - Thanks for asking your questions and welcome to the GeoNet community! I wanted to let you know that we're moving your question to the &lt;A href="https://community.esri.com/community/gis/web-gis/arcgisonline?sr=search&amp;amp;searchId=53087784-5625-4efb-8548-9de38eaf086b&amp;amp;searchIndex=0"&gt;https://community.esri.com/community/gis/web-gis/arcgisonline?sr=search&amp;amp;searchId=53087784-5625-4efb-8548-9de38eaf086b&amp;amp;searchIndex=0&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; background: white;"&gt;space so our Esri and user subject matter experts can further help answer this and future questions. &amp;nbsp;So you're aware on how and where to post your questions, here's a few quick tips and reminders:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: 'Helvetica Neue'; font-size: 10.5pt; font-weight: normal; font-style: normal;" type="1"&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 10.5pt; font-weight: normal; font-style: normal; background: white;"&gt;First, use the GeoNet search (top right corner by your profile icon) to search and see if your question has already by asked/answered previously.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;OL style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: 'Helvetica Neue'; font-size: 11.0pt; font-weight: normal; font-style: normal;" type="1"&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle; color: black;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 11.0pt; font-weight: normal; font-style: normal; color: black;"&gt;If not, than we suggest reviewing the&amp;nbsp;&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1544-geonet-community-structure"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 11.25pt; background: white;"&gt;GeoNet Community Structure&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 11.0pt; font-weight: normal; font-style: normal; color: black;"&gt;, to find the most relevant space to post your question.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;OL style="margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: 'Helvetica Neue'; font-size: 10.5pt; font-weight: normal; font-style: normal;" type="1"&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 10.5pt; font-weight: normal; font-style: normal; color: #3d3d3d; background: white;"&gt;The GeoNet&amp;nbsp;&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/community/help-and-feedback?sr=search&amp;amp;searchId=61184e1f-ac27-4180-b62a-99a9c2c1fc87&amp;amp;searchIndex=0"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 10.5pt; background: white;"&gt;GeoNet Help&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 10.5pt; font-weight: normal; font-style: normal; color: #3d3d3d; background: white;"&gt;&amp;nbsp;group is for questions and tips on how to use the GeoNet community platform not the Esri ArcGIS platform. Following steps 1 &amp;amp; 2 above will give you the best results for getting Esri product questions answered.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle; color: #3d3d3d;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 10.5pt; color: #3d3d3d; background: white;"&gt;This GeoNet 101 "How to Ask Questions on GeoNet" post is also a helpful guide to asking questions:&amp;nbsp;&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-to-ask-questions-and-get-answers"&gt;&lt;SPAN style="font-family: 'Helvetica Neue'; font-size: 11.0pt;"&gt;https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-to-ask-questions-and-get-answers&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 10.5pt; color: #3d3d3d;"&gt;&lt;SPAN style="background: white;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 10.5pt; color: #3d3d3d;"&gt;&lt;SPAN style="background: white;"&gt;Thanks again for contributing and I hope this helps and let us know if you have any questions.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 21:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424504#M33313</guid>
      <dc:creator>ChrisCatania</dc:creator>
      <dc:date>2017-06-09T21:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424505#M33314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CChristopher, this should be moved to the &lt;A href="https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=ce286c74-9a2c-45ea-a0e0-7479b33b4677&amp;amp;searchIndex=0"&gt;https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=ce286c74-9a2c-45ea-a0e0-7479b33b4677&amp;amp;searchIndex=0&lt;/A&gt;‌ with tags to &lt;A href="https://community.esri.com/community/gis/analysis/geoprocessing?sr=search&amp;amp;searchId=aa6234ee-0341-46d2-a326-aceebb116b00&amp;amp;searchIndex=0"&gt;https://community.esri.com/community/gis/analysis/geoprocessing?sr=search&amp;amp;searchId=aa6234ee-0341-46d2-a326-aceebb116b00&amp;amp;searchIndex=0&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 21:38:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424505#M33314</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-06-09T21:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424506#M33315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephanie,&lt;/P&gt;&lt;P&gt;What flavor (ArcMap/Catalog&amp;nbsp;v's Pro) and version are you using? &amp;nbsp;There are some differences between the two flavors for sure. &amp;nbsp;You may want to look at and bookmark &lt;A href="https://community.esri.com/blogs/dan_patterson/2016/05/09/the-links?sr=search&amp;amp;searchId=51799929-4e8d-497c-ae37-e8295602d240&amp;amp;searchIndex=0"&gt;/blogs/dan_patterson/2016/05/09/the-links?sr=search&amp;amp;searchId=51799929-4e8d-497c-ae37-e8295602d240&amp;amp;searchIndex=0&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;also, it would help if you would post you code (change any sensitive info) &lt;A href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=b8692a0c-a39b-4be4-bbcd-4b997bd8be2d&amp;amp;searchIndex=3"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=b8692a0c-a39b-4be4-bbcd-4b997bd8be2d&amp;amp;searchIndex=3&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you creating a tool in a toolbox and using the standard interface to create the user dialog? &amp;nbsp;Are you planning on creating a geoprocessing tool or will it just be run in the users session? Sorry for all the questions, but they may help others when responding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 21:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424506#M33315</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-06-09T21:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424507#M33316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rebecca,&lt;/P&gt;&lt;P&gt;I am using ArcGIS 10.5 products. I am creating a too in a toolbox using the standard interface. I am going to have it run in a user session.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually found that this works:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;ActiveNest &amp;nbsp;= arcpy.Select_analysis(inFeature, OutFeature, FieldForSelect = AttributeForSelect))&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My mistake was in setting the parameters for the variable in the script properties.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I do have a second question. My script at this point allows for two features to buffer. As the script runs it ask for the first field, attribute, &amp;nbsp;then second field, attribute. For this application I almost always only have two attribute I want to separate. But is there an easy way to code for a variable amount of inputs? Can you suggest some resources? I have kept my coding fairly simple in the past.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 22:08:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424507#M33316</guid>
      <dc:creator>StephanieHoutman</dc:creator>
      <dc:date>2017-06-09T22:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424508#M33317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you resolved your initial question.&lt;/P&gt;&lt;P&gt;FYI, in this case, you could typically mark your question as correct or as "assumed answered" so others would know it is resolved. &amp;nbsp;You could then start a new post if needed. &amp;nbsp;This keeps threads from getting too long and/or off topic. However, this is related enough that I think it's ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unfortunately I'm not at my desktop right now, so can't give specifics, but you can populate an input list of fields based on the input of the Layer and have it show a checkbox so the parameter creates a list. (Unless you want the user to know and type the field list, i.e. Think it would be "fields;field2")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ive done something similar, but as mentioned, not where I can look. &amp;nbsp;I'll tag a couple others that might know (if they haven't responded as I am typing this) &lt;A href="https://community.esri.com/people/Dan_Patterson"&gt;Dan_Patterson&lt;/A&gt;‌ &lt;A href="https://community.esri.com/people/curtvprice"&gt;curtvprice&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 22:20:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424508#M33317</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-06-09T22:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424509#M33318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a featureclass as a parameter (or table from one), then your next parameter could be a field which is 'derived' from the above... I think there is an sql parameter which would allow you to build a query within the dialog.&amp;nbsp; I don't have an example on hand, but the sequence of doing a query using your own tool is the same as you would from the standard dialog.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2017 00:08:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424509#M33318</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-10T00:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis using custom tool.</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424510#M33319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree, expose the SQL expression as a parameter depending on the input table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2017 02:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis-using-custom-tool/m-p/424510#M33319</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-06-10T02:06:02Z</dc:date>
    </item>
  </channel>
</rss>

