Prepending word with @ to trigger a db lookup in a text edit field?

  • Goal: Allow users to type a special symbol like @ before a word in a text edit field to trigger a database lookup and selection process (like autocomplete). This allows data to be directly referenced inside paragraphs of text, displayed as hyperlinks, and examined with a click.

  • Steps: I'm considering Retool for a project and this functionality is central to the use case. I've read the Editable Text Area | Retool Component Library and rich text component docs and know an event can be triggered upon value change but am not sure about triggering an event when the user types a specific key or symbol while entering text.

I would appreciate any thoughts or advice regarding Retool's suitability if this is a key functionality of the project.

HI there @davideps,

You can definitely have events triggered when the user types a specific key, e.g.

As you can see here, I'm submitting a query only when self value is not null and it starts with @. You can then also show/hide components containing your data results based on the same logic.

1 Like

fantastic. thank you for this!

1 Like