If you are looking to create a "search engine"-type control that can access a list of previous data entries and use auto-complete for searches, use a Combo Box. A Combo Box can store a list of previously entered strings, similar to a search history. The attached example can serve as a base to start your own combo box for your project.
Note: Code attached is compatible with LabVIEW 2016 and later.
How to Use
In the attached example, the Combo Box string control serves as the "search engine" input and each "query" or input is saved in an array which is the "search history."
When you open the VI, you will note that the Combo Box drop-down has is prepopulated with some items. If you want to edit or add items to the Combo Box drop-down, you can right-click on the Combo Box >> Edit Items ... >> Insert initial string values.
Run the VI.
Note that the Stored Strings array on the right side of the front panel populates with the Combo Box values.
The Sored Strings array is not necessary for the functionality of this example, just serves to visualize the previous searches.
Input a string (e.g. "what's up?") into the Combo Box control and press Enter. In the example, pressing enter adds an element into the Stored Strings arrayand updates the array stored in the Combo Box Stringsproperty.
Adding the array to the Combo Box Strings Property is what allows the object to show up in the drop-down for the control, and therefore allows the auto-complete nature of the control.
Now type another string in the Combo Box control that starts with the same letter/term as your previous search (e.g. "what's").
Note that the Combo Box will present suggestions from your previous searches (e.g. " up?" is highlighted) and if you press Enter at this time, your search will auto-complete with the suggestion.
Note that if you deviate from your previous search (e.g. "what's for dinner?"), the auto-complete suggestion leaves upon the first character deviating from the previous search.
Now add more searches and press Enter each time. Watch the Combo Box drop-down and Stored Strings array fill up with your inputs.
This example code limits the number of saved entries to the last 10 strings. This is defined in the "False" case within the "Enter Button" event. When there are fewer than 10 saved entries, a new entry can simply be inserted into the next index of the array.
Once you reach search #11, the Stored Strings array will add an element to capture your recent input and delete the oldest element. This way, there is always a list of <10 elements.
If you want to adjust the array size to be n items:
Change the input to the Compare function inside the Enter Button Event Structure to value n - 1(because arrays are 0-indexed)
Change the index from the Delete Array function in the False Case of the event's Case Structure to n.
The VI can be stopped by hitting the Stop button on the Front Panel.
In current state, stopping the VI will not clear the array or Combo Box strings, but the code could be edited to do so if desired.