Validate form input against existing data

Hi Team :wave: How to make a form validation when the value being entered already exist in the database? Show validation error that says “Value already exist”. Thanks in advance!

Which database are you using? In its schema, you should enforce the value uniqueness, so the insertion would fail if you try to insert some existing value.

Other than that, before inserting you could query the data source to check if that element exists. If it does, you can show the error. Otherwise, you continue with the insertion.

Hi @tiago :wave: I’m using Supabase but I disabled RLS for now. How do we handle backend failure in Plasmic App?

Hi Joey! You can use the result of previous steps in interactions actions. They are available as $steps. So if you can read the backend failure from that variable and act accordingly

Thanks @tiago ! Will try it out!

Btw, how does “Refresh Data” works? @tiago