<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>pickerFieldCustom to not select a value.</title><link>https://community.appian.com/discussions/f/general/37326/pickerfieldcustom-to-not-select-a-value</link><description>I have a custom picker field which is used to select the countries. From the list of all countries the user should not be able to select and save Great Britain and Northern Ireland. Can someone please suggest how I can achieve this.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: pickerFieldCustom to not select a value.</title><link>https://community.appian.com/thread/139732?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 15:11:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f018c52-602c-4830-a349-fa71349d11ca</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In addition to Konduru&amp;#39;s approach, you could always add a validation when the user DOES select one of these values.&amp;nbsp; Depending on the use case, this could be preferable sinec it might make more sense to users (as opposed to the option just not appearing, and them not understanding why).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pickerFieldCustom to not select a value.</title><link>https://community.appian.com/thread/139722?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 09:00:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d9cb6f7-e59e-4887-8882-0192a2615e7a</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;In your query could you simply add a queryFilter with &amp;quot;not in&amp;quot; operator and exclude the two values?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pickerFieldCustom to not select a value.</title><link>https://community.appian.com/thread/139721?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 08:57:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c052026b-96d3-4c44-a3d0-0cface8bc7ce</guid><dc:creator>p2005</dc:creator><description>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Suggest function code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* Rule returns a data subset with data as Country name   identifier as ISO  code and with 20 entries at a time*/
a!localVariables(
  local!saveCountryOrIsoCode: rule!APN_replaceNull(
    nullableValue: ri!saveCountryNameOrIsoCode,
    replacementValue: false
  ),
  local!isClusterIncluded: toboolean(
    rule!APN_replaceNull(
      nullableValue: ri!isClusterIncluded,
      replacementValue: false
    )
  ),
  local!pagingInfo: rule!APN_replaceNull(
    nullableValue: ri!pagingInfo,
    replacementValue: a!pagingInfo(
      startIndex: 1,
      batchSize: 20,
      sort: a!sortInfo(field: &amp;quot;country_txt&amp;quot;, ascending: true)
    )
  ),
  local!paginfoCluster: rule!APN_replaceNull(
    nullableValue: ri!clusterPagingInfo,
    replacementValue: a!pagingInfo(
      startIndex: 1,
      batchSize: 20,
      sort: a!sortInfo(field: &amp;quot;clusterName_txt&amp;quot;, ascending: true)
    )
  ),
  local!data: if(
    rule!APN_isEmpty(ri!filter),
    null,
    a!queryEntity(
      entity: cons!RGRACSLBL_ENTITY_COUNTRY_REGION,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(field: &amp;quot;isoCode_txt&amp;quot;, visible: true()),
            a!queryColumn(field: &amp;quot;country_txt&amp;quot;, visible: true())
          }
        ),
        logicalExpression: a!queryLogicalExpression(
          operator: &amp;quot;AND&amp;quot;,
          filters: {
            a!queryFilter(
              field: &amp;quot;region_txt&amp;quot;,
              operator: &amp;quot;&amp;gt;&amp;quot;,
              value: &amp;quot; &amp;quot;
            ),
            a!queryFilter(
              field: &amp;quot;country_txt&amp;quot;,
              operator: &amp;quot;includes&amp;quot;,
              value: ri!filter
            )
          }
        ),
        pagingInfo: local!pagingInfo
      )
    )
  ),
  local!data2: if(
    and(
      not(rule!APN_isEmpty(ri!filter)),
      local!isClusterIncluded
    ),
    a!queryEntity(
      entity: cons!RGRACSLBL_ENTITY_LABEL_LU_REF_CLUSTER,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(field: &amp;quot;clusterName_txt&amp;quot;, visible: true())
          }
        ),
        logicalExpression: a!queryLogicalExpression(
          operator: &amp;quot;AND&amp;quot;,
          filters: {
            a!queryFilter(
              field: &amp;quot;clusterName_txt&amp;quot;,
              operator: &amp;quot;in&amp;quot;,
              value: cons!RGRACSLBL_TEXT_CLUSTERS_REFERENCE_COUNTRY
            ),
            a!queryFilter(
              field: &amp;quot;clusterName_txt&amp;quot;,
              operator: &amp;quot;includes&amp;quot;,
              value: ri!filter
            )
          }
        ),
        pagingInfo: local!paginfoCluster
      )
    ),
    null
  ),
  if(
    local!isClusterIncluded,
    if(
      and(
        rule!APN_isEmpty(index(local!data, &amp;quot;data&amp;quot;, null)),
        rule!APN_isEmpty(index(local!data2, &amp;quot;data&amp;quot;, null))
      ),
      a!dataSubset(data: null, identifiers: null),
      a!dataSubset(
        data: reject(
          fn!isnull,
          append(
            index(
              index(local!data, &amp;quot;data&amp;quot;, null),
              &amp;quot;country_txt&amp;quot;,
              null
            ),
            index(
              index(local!data2, &amp;quot;data&amp;quot;, null),
              &amp;quot;clusterName_txt&amp;quot;,
              null
            )
          )
        ),
        identifiers: reject(
          fn!isnull,
          append(
            index(
              index(local!data, &amp;quot;data&amp;quot;, null),
              if(local!saveCountryOrIsoCode,  &amp;quot;country_txt&amp;quot;, &amp;quot;isoCode_txt&amp;quot;),
              null
            ),
            index(
              index(local!data2, &amp;quot;data&amp;quot;, null),
              &amp;quot;clusterName_txt&amp;quot;,
              null
            )
          )
        )
      )
    ),
    rule!APN_isEmpty(index(local!data, &amp;quot;data&amp;quot;, null)),
    a!dataSubset(data: null, identifiers: null),
    a!dataSubset(
      data: index(
        index(local!data, &amp;quot;data&amp;quot;, null),
        &amp;quot;country_txt&amp;quot;,
        null
      ),
      identifiers: index(
        index(local!data, &amp;quot;data&amp;quot;, null),
        if(local!saveCountryOrIsoCode,  &amp;quot;country_txt&amp;quot;, &amp;quot;isoCode_txt&amp;quot;), 
        null
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pickerFieldCustom to not select a value.</title><link>https://community.appian.com/thread/139719?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2024 08:49:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0c0bcb3-958d-41f2-9ba3-f2dd43538760</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Hello &lt;a href="/members/pavitrad2763"&gt;p2005&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please share the code snippet. The simple answer is when you are creating the ER for Array Picker used in the suggestFunction of&amp;nbsp;pickerFieldCustom, you need to remove the&amp;nbsp;&lt;span&gt;Great Britain and Northern Ireland values from the list that you are using for labels and identifiers.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>