SQL Connector: Return Id after insert query

Hello everyone,
Is there a way to get the id of newly inserted record right after insert query? I tried this:

INSERT INTO cases () VALUES (); 
SELECT LAST_INSERT_ID();

This query works fine in Workbench but SQL connector is giving error when running this query.

@razaadeel8 I’m not 100% but I don’t think the default Bubble SQL connector will allow you to run multiple statements. You would need to put this in a procedure and execute the procedure.

Alternatively we built a paid plugin to work with SQL data from a remote database. If you want to take a look the plugin info is here: SQL Database Connector Pro Plugin | Bubble

Documentation on configuring the standard (free) Bubble plugin and our plugin here: Configure SQL Connector - SQL Database Connector Pro

As a note if you wanted to get the ID from our plugin, make sure you use the INSERT query type and you would find the identity result in the JSON property as shown below:

Screenshot 2023-07-26 at 11.30.20 AM

Screenshot 2023-07-26 at 11.30.51 AM

1 Like