Add record to lookup/combobox on the fly

Add record to lookup/combobox on the fly

  
I have two tables. One is a "to do list" table and the other is a "category" table to support the to-do.
When I am adding a new "to-do" record I want to select a "category" from a lookup of some sort or combo box. But if the category I want to select is not in the list I'd like to type it in and when I click save on the primary "to-do" form it adds the new category to the list and saves the to-do record. I have seen people do this with a text box and as they type characters it narrows down the options in the list yet still allows new ones to be added if not in the list. Any idea on how to do this here?
Hi Jeff Adams,

The input ("text box and as they type characters it narrows down the options in the list") you refered is a autocomplete. It allows you to filter data from a source (record list, query, ...). Here is a little overview on how to use it - https://www.outsystems.com/forums/discussion/11834/autocomplete-boxes/ .

In order to accomplish what you are trying to do, and following the example given on the previous link you must change some things:

1 - in order to add a new record you must change the ation "GetValuesForAutoComplete" to keep the value inserted by the user and add it to the autocomplete list. By doing this, even when there is no result from the query, the value entered by the user is still available for selection.

2 - change the action that will create the "to do list". First validate if the value in the autocomplete input exists in the database (category table) in order to prevent duplicated records, if not create a new "category" record. After create the new "to do list" with the category id returned by the action used to create the new category.

Hope this helps 

Best regards...