Learn how to automatically assign records and show certain records to appropriate users
When building your app, you will likely need to ensure that users only have access to their records and not other logged-in users' records. Setting this up can be done in about 3 steps.
Step 1: Connection field to User from the table.
Ensure there is a field in your table with a connection to the Users table.
Step 2: Assign added records to logged-in user
Any place which has a form where users will be adding records, add a record rule to automatically assign the record to the logged-in user.
Open or add new form onto the page.
- Select Form Rules
- Choose the Record Rules tab
- Click Add New Rule
- Set the Values to the name of the field added in step 1 (in this case "Assigned To" to "Auto Logged User"
Note: You do not need to include the field in the actual form (In fact, we recommend that you don't).
Step 3: Filter components to only show logged-in user's records
Open any component that displays data (Table, List, Calendar, Chart, Map etc.)
Once you have the component settings open:
- Click on Data Source
- Press the Add Filter Group button
- Choose the field that you added in step 1 (In our case its Assigned To)
- Set the value to is logged in user
That's it! Now all records added to the database from your app will automatically be assigned to the logged-in user. Please remember that you must add the Data Source filter (Step 3 from above) to any and all components you wish to filter records for, including Calendars, Maps, Lists, Charts, etc.
To see a video of this in action: