<?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: Remove Option from Toolbox Parameter Value List if Selected in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1231429#M62216</link>
    <description>&lt;P&gt;I understand your use case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have mine which I have provided an example for.&lt;/P&gt;&lt;P&gt;I wouldn't want your workflow to be the only one.&lt;/P&gt;&lt;P&gt;And there is no way to disable it.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 20:36:59 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-11-14T20:36:59Z</dc:date>
    <item>
      <title>Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230809#M62125</link>
      <description>&lt;P&gt;I have a tool which has a string parameter with a predefined value list filter, allowing the user to select multiple options from a dropdown list in the GUI.&lt;/P&gt;&lt;P&gt;However, when they select one option, I would then like that option to be removed from the list which they&amp;nbsp; choose the next option from. Is this possible, and if so how? In an ideal world it would be the default behavior, because I struggle to think of why you would want to put the same option in twice as a user, but you can.&lt;/P&gt;&lt;P&gt;In the image below the Value List filter comprises A, B, C and D. As you can see the user has chosen A for the first entry and B for the second. I would like the options for the next entry to just be C and D, so they can't errantly pick A or B again...but that isn't the case.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardHowe_0-1668157826483.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55806i41B7828F4EC1370D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardHowe_0-1668157826483.png" alt="RichardHowe_0-1668157826483.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel perhaps some kind of validation is probably the answer to this, but I can only find documentation to make individual parameters dependent on another parameter, not on entries for the same multi value parameter.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 09:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230809#M62125</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-11-11T09:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230831#M62128</link>
      <description>&lt;P&gt;To ensure sorted order&lt;/P&gt;&lt;LI-CODE lang="python"&gt;vl = ['A', 'A', 'B', 'C', 'D', 'D']
out = sorted(list(set(vl)))
out
['A', 'B', 'C', 'D']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and uniqueness in your validation&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:14:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230831#M62128</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-11-11T10:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230832#M62129</link>
      <description>&lt;P&gt;Dan, thanks. I understand how to script for removing accidental duplicate picks, that isn't an issue. I just don;t want them to be able to do it. It just seems illogical that it will show already selected values in the dropdown&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:16:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230832#M62129</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-11-11T10:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230837#M62131</link>
      <description>&lt;P&gt;unless you want to use the value list to process things in a certain order with repeats, like recalculating coordinates for featureclasses in different coordinate sytems (eg. 'A', 'A', 'B') some with repeats, others without&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:27:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230837#M62131</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-11-11T10:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230838#M62132</link>
      <description>&lt;P&gt;Perhaps I'm not being particularly clear. Apologies.&lt;BR /&gt;&lt;BR /&gt;If the user picks A for the first entry, then I don;t want A to appear in the list of options they can pick from in the next row. Imagine if this was the delete fields tool, it wouldn't allow the user to pick the same field to delete twice, once it was selected once, then it wouldn't be in the list of options they could pick to delete at the same time&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230838#M62132</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-11-11T10:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230841#M62135</link>
      <description>&lt;P&gt;In my example I was clear about enabling the user to be able to select the same input more than once in an order that I want for processes that provide a list for me to process.&amp;nbsp; If your workflow requires unique entries, then do this during validation of the inputs.&amp;nbsp; In that fashion, the widest possible uses of a value list can be attained, eg. those with unique values or not, those in any order or not.&amp;nbsp; Different workflows shouldn't be disabled because or user preferences may differ&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1230841#M62135</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-11-11T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1231199#M62179</link>
      <description>&lt;P&gt;I still don't think you understand my question. I am providing a pre-populated value list filter for a single parameter, that allows multiple values. That single parameter shows the dropdown list to the user in the toolbox GUI and they can pick an item from it, then, if they wish to pick another item from it, for the same parameter, they can. However I don't want them to be able to select the same value again and I still can't visualise a use case for picking exactly the same value as a second input to the same parameter. Regardless of which, I would like to know how to prevent it happening.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 12:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1231199#M62179</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-11-14T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1231429#M62216</link>
      <description>&lt;P&gt;I understand your use case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have mine which I have provided an example for.&lt;/P&gt;&lt;P&gt;I wouldn't want your workflow to be the only one.&lt;/P&gt;&lt;P&gt;And there is no way to disable it.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 20:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1231429#M62216</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-11-14T20:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1380621#M78576</link>
      <description>&lt;P&gt;Hey Richard,&lt;/P&gt;&lt;P&gt;I feel obligated to reply because the response you received is incorrect... I achieved what you are describing.&amp;nbsp; My approach would look something like this with your situation:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateParameters(self, params):
    filtervals = ['A', 'B', 'C']
    try:
        ## create a list of previously selected values from filter list
        paramvals = params[0],valueAsText.split(";")  
        ## remove selected values from temporary filter list 
        for val in paramvals:
            ## list of selected values contains apostrophes, so must remove them
            filtervals.remove(val.replace("'",""))
        ## reassign filter list after removing selected values
        params[0].filters[0].list = filtervals
    except:
        ## this avoids error message if user has not selected anything
        pass

def updateMessages(self, params):
    ## removing previously selected items from the filter list creates an error message 
    ## next to previously selected items saying they are not in the list... 
    ## the tool still works as intended, so I just clear that message to make it look cleaner
    params[0].clearMessage()&lt;/LI-CODE&gt;&lt;P&gt;Anyways, I wanted to share because I almost gave up after reading the response to your question.&amp;nbsp; It seems more intuitive for it to behave like you describe though.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 21:21:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1380621#M78576</guid>
      <dc:creator>tyler_fossett</dc:creator>
      <dc:date>2024-02-09T21:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1380939#M78623</link>
      <description>&lt;P&gt;Tyler, you legend. Thank you!!!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 08:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1380939#M78623</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2024-02-12T08:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Option from Toolbox Parameter Value List if Selected</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1381638#M78696</link>
      <description>&lt;P&gt;Happy to help!&amp;nbsp; I did notice room for improvement with original code... if the user exhausts the list to the point where no more items should be shown, the original code I provided shows the full list again if the user keeps trying to select values.&lt;/P&gt;&lt;P&gt;This can be solved by replacing line 11 in the original code with lines 9-12 below.&amp;nbsp; I added a line to my execute function as well so it ignores the space placeholder.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateParameters(self, params):
    filtervals = ['A', 'B', 'C']
    try:
        paramvals = params[0],valueAsText.split(";")  
        for val in paramvals:
            filtervals.remove(val.replace("'",""))

        ## ******************************************
        if not filtervals:
            params[0].filters[0].list = [" "]
        else:
            params[0].filters[0].list = filtervals
        ## ******************************************

    except:
        pass&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-option-from-toolbox-parameter-value-list-if/m-p/1381638#M78696</guid>
      <dc:creator>tyler_fossett</dc:creator>
      <dc:date>2024-02-13T16:06:12Z</dc:date>
    </item>
  </channel>
</rss>

