Searching data lists

I searched the forum but couldn’t find what I was looking for, maybe I am searching the wrong phrase.

Thanks to some very helpful posts here, I have created a search bar and set it up to search a specific data list, but I am wondering if there is a way to account for different variations of spelling. For instance if my list data list contains Soybean Oil and they type in soybean oil or Soy Bean Oil I would still like it to be seen as found. Is there any way to acomplish this?

I think to do this well you would need an API that handles those sorts of data checks. I don’t know of one to recommend. You can at least ignore case by converting the input into lowercase using Thunkable blocks. That way “Soybean Oil” and “soybean oil” and “SOYbean OIL” are equivalent.

Edit: I asked Microsoft Copilot (ChatGPT 4) your question and it suggested this:

Yes, Google does offer an API that can help with spelling variations and corrections. The Google Spell Check API, provided by SerpApi, extracts “Did you mean?” suggestions and other spelling and grammar corrections1. This API can be particularly useful for dynamically handling large lists of items where you expect various spelling inputs from users.

Here’s a simplified example of how you might use the Google Spell Check API with Thunkable:

  1. User Input: Get the search query from the user.
  2. API Request: Send the user’s query to the Google Spell Check API.
  3. API Response: Receive suggestions or corrections from the API.
  4. Search Your List: Use the corrected or suggested spelling to search your list.

By integrating this API, you can dynamically account for different variations of spelling in user searches, matching “SOYBEAN OIL” with “Soy Bean Oil,” for instance.

Additionally, Google’s Custom Search API also provides spelling suggestions which can be used to correct queries and improve search results2.

Remember to check the API documentation for specific implementation details and to ensure it fits your application’s needs. Also, consider the API usage limits and potential costs associated with using these services.

Need help? How to Ask Great Questions :sparkles: Debugging A Project :sparkles: API JSON Tutorial

Want to hire a Certified Thunkable Expert? Elevate your app with Tatiang on Fiverr

Thank you! This was very helpful. I appreciate your time.

1 Like