<?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>custom picker</title><link>https://community.appian.com/discussions/f/general/20242/custom-picker</link><description>Hi All, 
 i have a requirement to create custom picker for populating country code based on the country name or country code entered. 
 for eg: if i enter USA then it should show 1 and if i enter 1 then it should show all the codes containing 1. 
 My</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: custom picker</title><link>https://community.appian.com/thread/79881?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 16:56:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6431e5bd-6afe-4201-9b11-9341ff0cee33</guid><dc:creator>Max</dc:creator><description>&lt;p&gt;Hello, good morning, I&amp;#39;m sorry. I occupy the same thing that you can&amp;#39;t stay. What did you modify? your answer would help me a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/79002?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 14:20:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8be1c79-3fe7-4534-a39a-c5d4651853d0</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;cool, thanks for confirming/verifying.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78999?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 07:50:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3022bb44-8e0b-4716-bc5f-f76f96dd4927</guid><dc:creator>pradeepb0001</dc:creator><description>&lt;p&gt;i made some modification to your code and it worked perfectly.Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78998?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 05:26:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:80733049-ec74-42ef-a5ad-9bfee2b6d5c0</guid><dc:creator>pradeepb0001</dc:creator><description>&lt;p&gt;Thank you&amp;nbsp;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt; for your reply,will work on your suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78990?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 15:36:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb6f4614-cac2-4a91-b369-b274b7889980</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;As a followup: you would also be able to make the search work for &amp;quot;any country ID that contains the character &amp;#39;1&amp;#39;&amp;quot;, however you would need a special column in your view, in which you cast the country ID to VARCHAR (text) instead of integer, as appian queries are unable to do an &amp;quot;includes&amp;quot; style query on integers.&amp;nbsp; I just did this recently and it works like a charm.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For this scenario you should definitely use a view, and the text-cast column should be an *additional* column.&amp;nbsp; As long as you&amp;#39;ve done that, then you would replace the &amp;quot;countryId&amp;quot; component of the filter set with the following, which is actually slightly more simple:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!queryFilter(
  field: &amp;quot;countryIdText&amp;quot;,
  operator: &amp;quot;includes&amp;quot;,
  value: fv!item,
  /* applyWhen: not(rule!PROJECT_RULE_isBlank(tointeger(fv!item))) */
),&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78989?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 15:31:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b73ecbad-8157-4741-afb0-71dabbfe1439</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The following suggest function would do what you&amp;#39;re asking for - matching either on exact country id or on country name.&amp;nbsp; As a bonus, a user would be able to type multiple parts of a country&amp;#39;s name separated by a space and get results that have some match for all typed parts.&amp;nbsp; Thanks to the flexibility of the &lt;em&gt;&lt;strong&gt;a!queryLogicalExpression()&lt;/strong&gt;&lt;/em&gt; construct (with the ability to nest and loop to basically any extent you could possibly want), we have a lot of flexibility with what search results are achievable, this being just one of a multitude of different possibilities.&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(

  local!searchTextParts: a!forEach(
    split(ri!searchText, &amp;quot; &amp;quot;),
    if(rule!PROJECT_RULE_isBlank(fv!item), {}, fv!item)
  ),

  local!query: a!queryEntity(
    entity: cons!PROJECT_ENTITY_VIEW_COUNTRY_PICKER, /* DSE constant pointing to your countries table or view */
    query: a!query(
      logicalExpression: a!queryLogicalExpression(
        operator: &amp;quot;AND&amp;quot;,
        filters: {
          a!queryFilter(
            field: &amp;quot;countryId&amp;quot;, 
            operator: &amp;quot;not null&amp;quot;
          )
        },
        logicalExpressions: {
          a!queryLogicalExpression(
            operator: &amp;quot;AND&amp;quot;,
            logicalExpressions: a!forEach(
              local!searchTextParts,
              
              a!queryLogicalExpression(
                operator: &amp;quot;OR&amp;quot;,
                filters: {
                  a!queryFilter(
                    field: &amp;quot;countryId&amp;quot;,
                    operator: &amp;quot;=&amp;quot;,
                    value: fv!item,
                    applyWhen: not(rule!PROJECT_RULE_isBlank(tointeger(fv!item)))
                  ),
                  a!queryFilter(
                    field: &amp;quot;countryName&amp;quot;,
                    /* OPERATOR can be either &amp;quot;starts with&amp;quot; or &amp;quot;includes&amp;quot; depending on your preference and/or project requirements */
                    operator: &amp;quot;includes&amp;quot;,
                    value: tostring(fv!item)
                  )
                }
              )
            )
          )
        }
      ),
      pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: 20,
        sort: a!sortInfo(
          field: &amp;quot;countryId&amp;quot;,
          ascending: true()
        )
      )
    )
  ),

  a!dataSubset(
    data: a!forEach(
      local!query.data,
      rule!PROJECT_Format_countryPickerLabel(country: fv!item) /* this rule would accept the Country CDT and return a single line of text representing how the Country name (and other details if desired) will appear in suggestion results as well as in the selected items list in the parent rule */
    ),
    identifiers: property(local!query.data, &amp;quot;countryId&amp;quot;, {})
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78985?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 15:17:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb54d571-905f-4f02-bedb-b3fa41de80dc</guid><dc:creator>pradeepb0001</dc:creator><description>&lt;p&gt;Thank you for your reply.If possible can you please provide any example for suggestion function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom picker</title><link>https://community.appian.com/thread/78983?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 14:33:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:819e04f8-c473-4fc7-b4e1-20294e879978</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/pradeepb0001"&gt;pradeepb0001&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;If my understanding of your question is correct, then the answer would be &lt;strong&gt;yes&lt;/strong&gt;. We can configure the custom picker to search based on different field data(such as name and code) and we can configure this in the suggestion function rule. But however, only one data subset can be returned as an output from the suggestion function &amp;amp; can be used inside the picker.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>