Calling Postgres Function

Hey Everyone. I was wondering if anyone has used the SQL Connector to successfully call a function in Postgres. I have the following statement: SELECT * FROM execute_generated_sql() AS (First_Name text, Last_Name text, Age text)

This works find when hard coded but I want to pass through First_Name text, Last_Name text, Age text as parameter. I have tried he typical SQL synatx for parameters but that does not work.

Any ideas? Thank you.

I just wrote a quick test to make sure this worked as expected and it does. You need to use $1 /$2/etc as the parameter names. See configuration below:

If you find that you eventually need more than offered from the free Bubble plugin, you can find our paid plugin here: SQL Database Connector Pro Plugin | Bubble

We also have some documentation on configuring the standard (free) Bubble plugin here for reference: Configure SQL Connector - SQL Database Connector Pro

Hey Ben. Thank you. This is super helpful and I will definitely check out your SQL Database Connector. I have tested a function with parameters that are numbers and they work ok, but if I need to pass text into the function, that is when I get an error. For example, I need to pass ‘First_Name text, Last_Name text, Age text’ as the parameter string. I think there is an issue when Bubble attempts to pass these values.

I’m not sure why that wouldn’t work, I tried with text parameter now and it worked properly. Let me know if you can’t get it figured out and I can try to assist further.

This topic was automatically closed after 70 days. New replies are no longer allowed.