Add an onKeyPress event listener to the #iptSearch text box. It will pass the desired shape entered to the findShape function after a two second delay to ensure the use has finished typing. The findShape function executes a wixData.query on the #Shapes collection. If the desired shape is not found, a message is sent to #txtMessage advising the user. If the desired shape is found, then the colour is retrieved from the record and displayed to the user in #txtMessage.
The toTitleCase function converts the users shape input to title or proper case, which matches the case in the #Shapes collection - as the wixData.query function is case sensitive.