Create a secure public form
Try it out!
Scenario
This is for situations where you want to collect data from unauthenticated users, but want to keep your table secure so that only App admins can see the submitted data. With the release of Budibase 3.0, table RBAC has been streamlined, so we'll use automations to write this data securely to the table. It's ideal for public forms like surveys where a user submits data and doesn't ever have to see it again.
★★☆☆☆
Steps
-
In the Data section, create a new table with columns for the data you want to capture. By default, only App admins can access this table, which is fine for our example.
-
In the Design section, create a new screen for your form
-
Set the screen's Access to
Public user
-
Build a Form with field components that suit your table's schema.
Generating fields from the Form Schema
You can use your table as the Form Schema to generate the relevant field components in a Field Group, but please note that a public user won't have access to that schema, so they may see errors when using the app. Once you have created your form fields, switch the Form Schema to Custom to prevent any issues for public users.
-
In the Automation section, create a new automation that is triggered by an App Action
-
Change the role for this automation to
Public user
-
Add fields that match the fields in your form
-
Add a Create Row step to the automation
-
Select the relevant table and use the relevant bindings from your automation trigger for each column value
-
Go back to your screen in the Data section and add a Button component, which we'll use to submit your form
-
Add a Trigger Automation On click action to the Button that triggers the automation we made
-
Add bindings from your Form fields to send them to the automation
-
Publish the app and test the public form in a private window
App export
Downloads may take a few seconds.
Updated 17 days ago