Aug 18, 2025 Hi Fam.. Background With this route / handler, you are able to execute inserts in your database using parameterized sql command. You can also specify which fields should be returned from the record that was added. Copy the attached file to your pb_hooks directory and restart the app. Example SQL Statement generated internally. Code: INSERT INTO bma_course (name,startdate,enddate,manager,active,id,created,updated) VALUES ({:name},{:startdate},{:enddate},{:manager},{:active},{:id},{:created},{:updated}) Usage The path should contain the collection and the id you want to add. Predefined id are required to meet my use case Code: http://127.0.0.1:1001/api/rawinsert/bma_course/n1234567898 Give it the body to add and the fields (optional) to return. Code: { "record": { "name": "Anele Testing Insert", "startdate": "2025-01-01", "enddate": "2025-12-31", "manager": "123456", "active": "true" }, "fields": "id,name,manager" } Output Code: { "id": "n1234567898", "manager": "123456", "name": "Anele Testing Insert", "success": true } Attachments rawinsert.pb.js.zip rawinsert.pb.js.zip 1.4 KB · Views: 224 Click to expand...
Hi Fam.. Background With this route / handler, you are able to execute inserts in your database using parameterized sql command. You can also specify which fields should be returned from the record that was added. Copy the attached file to your pb_hooks directory and restart the app. Example SQL Statement generated internally. Code: INSERT INTO bma_course (name,startdate,enddate,manager,active,id,created,updated) VALUES ({:name},{:startdate},{:enddate},{:manager},{:active},{:id},{:created},{:updated}) Usage The path should contain the collection and the id you want to add. Predefined id are required to meet my use case Code: http://127.0.0.1:1001/api/rawinsert/bma_course/n1234567898 Give it the body to add and the fields (optional) to return. Code: { "record": { "name": "Anele Testing Insert", "startdate": "2025-01-01", "enddate": "2025-12-31", "manager": "123456", "active": "true" }, "fields": "id,name,manager" } Output Code: { "id": "n1234567898", "manager": "123456", "name": "Anele Testing Insert", "success": true }