Once a user has created a tag and saves it to the database for the users account, when the user comes back or another user in the same account comes back, and begins to enter the same tag it shows in a dynamic partial search any tag which matches the partial entered text, which they are able to select like the image shown below:
The purpose of this is to ensure that the user is aware the tag already exists and we don’t duplicate tags in the database, or there is a similar tag they can choose form rather than creating a new one.
Is this a big ask with current Wappler? or is there a way to achieve this?
To stop duplicating tags you can use the validation rule of exists in database and throw a error if the user enters a value already in the database
As for searching the database here’s the docs on how to do this
You’d just create your own drop down however you wanted as long as its checking the text input its fine to create however you please
After that you could create a dynamic event when you click the value in the dropdown which would set the input of the text input to what ever the value is of what the database returns
On a side note you mention them choosing the tag if this is in the same text input as the creation you may need a condition to check If it exists in the database if not create one and do whatever or if it exists just do whatever
With the new “no results” option in Wappler, I think you can acheive what you want via autocomplete component.
I have not used it myself, but a quick search in community should put you on the right track.
Thanks Sid, I tried autocomplete but can’t seem to get the tag functionality and the autocomplete to work together. You can autocomplete on search but hitting enter doesn’t save the tag to the array.
Selecting the "no results" option should give you an event to act upon.
And you can change the text of the "no results" to something like "Add this tag" too, I think.
Unfortunately it doesn’t work it just gives yo the below. There is now logical reason it shouldn’t work, but appears clicking the no results action to add the text content to the array does not actually add anything to the array.
I may ahve to try caviling together a work around as suggested by @Sorry_Duh