<?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>picker and text field</title><link>https://community.appian.com/discussions/f/user-interface/18458/picker-and-text-field</link><description>Hi all , 
 I have the requirement , 
 When user types in the field , it shows down the list as suggestion but it also allows to save what is not in list . (Eg: when &amp;quot;a&amp;quot; is typed : --&amp;gt; {&amp;quot;apple&amp;quot;,&amp;quot;aeroplane&amp;quot;,&amp;quot;awesome&amp;quot;} is suggested . But when user types</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78147?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2020 05:25:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7303e35f-1794-4e96-8b36-459bc7d24cef</guid><dc:creator>vinayp0002</dc:creator><description>&lt;p&gt;Got the issue, In your suggested function ,&amp;nbsp;&amp;nbsp;fetchTotalCount is not set but checking the condition based on total count.&lt;/p&gt;
&lt;p&gt;So, It works fine now with the below code :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=if(
  isnull(ri!search),
  todatasubset({}),
  with(
    local!types: a!queryEntity(
      fetchTotalCount: true(),
      entity: ri!entity,
      query: a!query(
        filter: a!queryFilter(
          field: ri!fieldName,
          operator: &amp;quot;includes&amp;quot;,
          value: lower(ri!search)
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 10,
          sort: a!sortInfo(
            field: ri!fieldName,
            asending: true
          )
        )
      )
    ),
    if(
      local!types.totalCount &amp;gt; 0,
      a!dataSubset(
        startIndex: 1,
        batchSize: 10,
        totalCount: local!types.totalCount,
        data: index(local!types.data, ri!fieldName, {}),
        identifiers: local!types.identifiers
      ),
      a!dataSubset(
        startIndex: 1,
        batchSize: 1,
        totalCount: 1,
        data: ri!search,
        identifiers: ri!search
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78125?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 14:46:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:68b60dd0-c8a9-4c75-aa5a-7a6887905378</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is correct. Now this is a partially evaluated reference to you suggestion rule. The &amp;quot;_&amp;quot; is doing that. At runtime, the &amp;quot;_&amp;quot; will be replaced be the text entered by the user.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/20.3/Expressions.html#parallel-evaluation-of-expressions"&gt;https://docs.appian.com/suite/help/20.3/Expressions.html#parallel-evaluation-of-expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I do not know why your expression does not return values. Test it in isolation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78124?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 14:38:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a97fbdad-5cae-4866-a055-8ced428e22c9</guid><dc:creator>vinayp0002</dc:creator><description>&lt;p&gt;Do you mean to keep in the below format?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;suggestFunction: rule!CDS_RULE_ucArrayPickerFilter(
                  search: _,
                  entity: cons!CDS_ENTITY_PRODUCT,
                  fieldName: &amp;quot;reviewName&amp;quot;
                ),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In this case, I am not getting any suggestions for existing values&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78121?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 14:00:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a19c4b8-3594-4ebd-bde6-a9e1ffefdd76</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Line 7 is wrong. Check&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/20.3/recipe-configure-an-array-picker.html"&gt;docs.appian.com/.../recipe-configure-an-array-picker.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78120?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 13:50:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0b862be9-6d23-4fec-b194-5f9b0177755b</guid><dc:creator>vinayp0002</dc:creator><description>&lt;p&gt;Below is the code :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!pickerFieldCustom(
                label: &amp;quot;Product&amp;quot;,
                labelPosition: &amp;quot;ABOVE&amp;quot;,
                maxSelections: 1,
                suggestFunction: rule!CDS_RULE_ucArrayPickerFilter(
                  entity: cons!CDS_ENTITY_PRODUCT,
                  search: fv!item.name,
                  fieldName: &amp;quot;reviewName&amp;quot;
                ),
                selectedLabels: a!forEach(
                  items: fv!item.name,
                  expression: fv!item
                ),
                placeholder: &amp;quot;Type to see existing products&amp;quot;,
                value: fv!item.name,
                saveInto: {
                  fv!item.name,
                  a!save(
                    ri!lppcProduct[fv!index].name,
                    save!value
                  )
                }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Getting error at custom picker -&amp;nbsp;&lt;span&gt;TExpression evaluation error at function a!pickerFieldCustom [line 35]: The function &amp;#39;suggestfunction&amp;#39; is unavailable.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78119?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 13:31:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0079877a-04a0-40c0-8561-fd5c1ff2767d</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What is the code of your picker?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/78117?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 13:06:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab7e022d-bc29-411f-90f8-b02a55242870</guid><dc:creator>vinayp0002</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;I tried changing the suggest function as you mentioned. But I am getting error - Suggest function is unavailable.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=if(
  isnull(ri!search),
  todatasubset({}),
  with(
    local!types: a!queryEntity(
      entity: ri!entity,
      query: a!query(
        filter: a!queryFilter(
          field: ri!fieldName,
          operator: &amp;quot;includes&amp;quot;,
          value: lower(ri!search)
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 10,
          sort: a!sortInfo(
            field: ri!fieldName,
            asending: true
          )
        )
      )
    ),
    if(
      local!types.totalCount &amp;gt; 0,
      a!dataSubset(
        startIndex: 1,
        batchSize: 10,
        totalCount: local!types.totalCount,
        data: index(local!types.data, ri!fieldName, {}),
        identifiers: local!types.identifiers
      ),
      a!dataSubset(
        startIndex: 1,
        batchSize: 1,
        totalCount: 1,
        data: ri!search,
        identifiers: ri!search
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Could you please let me know, if anything is missing?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/73276?ContentTypeID=1</link><pubDate>Sun, 12 Apr 2020 13:36:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:defa0d37-0bfc-4192-8814-861e6f26ba0a</guid><dc:creator>arunramanathtm</dc:creator><description>&lt;p&gt;Create an expression rule with the below code snippet and call this rule in your &lt;strong&gt;SUGGEST FUNCTION:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Expression Rule inputs:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;choiceList: text(multiple)&lt;/p&gt;
&lt;p&gt;searchValue: text&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Code:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if(&lt;br /&gt; contains(ri!choiceList,ri!searchText),&lt;br /&gt; a!dataSubset(&lt;br /&gt; startIndex: 1,&lt;br /&gt; batchSize: -1,&lt;br /&gt; totalCount: count(ri!choiceList),&lt;br /&gt; data: ri!choiceList,&lt;br /&gt; identifiers: ri!choiceList&lt;br /&gt; ),&lt;br /&gt; a!dataSubset(&lt;br /&gt; startIndex: 1,&lt;br /&gt; batchSize: 1,&lt;br /&gt; totalCount: 1,&lt;br /&gt; data: ri!searchText,&lt;br /&gt; identifiers: ri!searchText&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: picker and text field</title><link>https://community.appian.com/thread/72642?ContentTypeID=1</link><pubDate>Sun, 15 Mar 2020 18:14:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb90b0c0-f11d-4852-a493-e38e006b0bcf</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Hi. I implemented exactly this a few years ago. The trick is in the suggest function. If the user enters a value which is not known, I just add the search value to the returned data sub set. See below code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=if(
  isnull(ri!search),
  todatasubset({}),
  with(
    local!types: a!queryEntity_18r3(
      entity: cons!EIF_ENTITY_TAGS,
      query: a!query(
        filter: a!queryFilter(
          field: &amp;quot;search&amp;quot;,
          operator: &amp;quot;includes&amp;quot;,
          value: lower(ri!search)
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 10,
          sort: a!sortInfo(
            field: &amp;quot;name&amp;quot;,
            asending: true
          )
        )
      )
    ),
    if(
      local!types.totalCount &amp;gt; 0,
      a!dataSubset(
        startIndex: 1,
        batchSize: 10,
        totalCount: local!types.totalCount,
        data: index(local!types.data, &amp;quot;name&amp;quot;, {}),
        identifiers: local!types.identifiers
      ),
      a!dataSubset(
        startIndex: 1,
        batchSize: 1,
        totalCount: 1,
        data: ri!search,
        identifiers: ri!search
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>