Skip to main content
hirushiharant0001
March 19, 2022
Solved

Custom picker component for dynamic inputs

  • March 19, 2022
  • 5 replies
  • 1 view

Hi,

Is it possible to use a!pickerFieldCustom() for dynamic inputs?

For example, while I type a word in a!pickerFieldCustom() component, it has to filter from the database and show the returned query in the a!pickerFieldCustom() component dropdown.

Thankyou.

Best answer by harshitb6843

Yes. It is a very common usecase of a custom picker. 
For this, in your suggestion function, query the data from a table based on the searchText received in RI. Use that searchText to pass in the queryRule, under includes parameter and then from the data subset returned, create a dictionary of identifiers and data. 

Like this, you should be able to dynamically get the values from the DB based on what user searched. 

5 replies

gopalk2865
Participating Frequently
March 19, 2022

Hi, Yes you can do that . Please go through below link for your reference,

[View:https://docs.appian.com/suite/help/22.1/recipe-configure-an-array-picker.html]

hirushiharant0001
March 19, 2022

Thank you Gopalk.


This is not my requirement. In https://docs.appian.com/suite/help/22.1/recipe-configure-an-array-picker.html already we query all the values, store it in a local variable and then filter it using the input we give.

But my requirement is to query using the input we given.

gopalk2865
Participating Frequently
March 19, 2022

You would need to write an expression rule for querying the data from db  with filter for your suggest function. Then you can use this rule in the function to get what you are looking for.

harshitb6843
March 19, 2022

Yes. It is a very common usecase of a custom picker. 
For this, in your suggestion function, query the data from a table based on the searchText received in RI. Use that searchText to pass in the queryRule, under includes parameter and then from the data subset returned, create a dictionary of identifiers and data. 

Like this, you should be able to dynamically get the values from the DB based on what user searched. 

hirushiharant0001
March 20, 2022

Thank you @Gopalk & [mention:ef600ff8f5d2497eb2def2126dc89484:e9ed411860ed4f2ba0265705b8793d05]. It is working.