I am new to Appian and facing challenges in using customFieldPicker, we need to implement:
Do we have any Field where user can search for exiting list of values from database, and if value(text column in our case) is not there in the list then whatever value user has typed in can be written to DB on the form submission. Later the value will become part of the list.
We implemented it like this:
We have one table having 2 fields- id and text only. The ER we created is attached below:
We are unable to save the value. Please let me know what I am doing wrong.
Discussion posts and replies are publicly visible
appiant0003 said:facing challenges in using customFieldPicker
TBH it's not an easy component to use, at least if (as in my case) you don't use it frequently.
appiant0003 said:whatever value user has typed in can be written to DB on the form submission
Frankly you'd be better off (in terms of sanity in general, as well as later maintainability) just separating this out to a whole separate field.
For instance you could have the user check a checkbox saying "i need to enter my own new value", and after that, show a text box where they can freely type in the new value. This could be designed as an "alternate field" where it shows up below the original custom picker selection box, or where it replaces the custom picker box altogether in the same spot, such that it appears to have just changed functionality (whereas really in the back-end you've swapped in a completely different component).
Additionally, and strangely enough, I just posted a solution for almost the exact same question 3 days ago in this thread..
Basically what we do in this case where we need to use the picker component only, is append the search value to the searchFunction (when it does not exist) in the datasubset that is returned to the picker. Query for data, return data+search.
After the form is submitted, query the DB to see if the selected value actually exists, and if not, write it to the list.
Chris said:append the search value to the searchFunction (when it does not exist) in the datasubset that is returned to the picker
Oh nice, I was wondering how this would work. I feel like I must've seen something similar before, but TBH i use the function so infrequently I usually forget. The only thing I've used it for in the past that I really like is an "alternate user picker" i made, which allows users to be picked from the DB, and can include deactivated folks (and can allow them to be searched by their DB PKID, which we expose to the end users as the person's personal ID). But of course for this there's no need for adding entries via component trickery.
Yea, our biggest use case for this component is also as a Custom User Picker essentially. With ~30k licensed employees, there are so many similarly named user accounts, we can't use the OOTB picker at all, unless we are stuck with it such as with the built-in task reassignment GUI. Works great in all other cases though, as you note you can expand the search to employee IDs, append metadata to the display such as city, state, division, department, etc. We have a few financial pickers for project/task values also, and some other cases sprinkled around here and there.
We have only had a few situations for appending values to the picker, one in a professional certification request - we maintain a list of known certs, but there are always new ones we don't know about. One other is in a Meeting Minutes type app I have, where meetings are joined by Topic, the Topic searches for prior meetings and also lets a new one be created in the same place. I do have to admit, I find that to be pretty clunky in use however.
Thanks Mike Schmitt
Thanks Chris, it worked well.
Appreciate your support!
© 2022 Appian. All rights reserved.