Create, read, update, and delete data in your Base44 app
The entities module lets you work with your app’s data. Each entity type in your app has methods for creating, reading, updating, and deleting records.You access entity methods through your entity name: base44.entities.YourEntityName.methodName(). For example, if you have a Task entity, you use base44.entities.Task.list() to get a list of tasks.
Data access is controlled by the client’s authentication mode and your app’s permission rules. You can configure the permissions for each entity in your app’s security settings. Learn more about changing data permissions.
Anonymous users: Can only access entities marked as public.
Authenticated users: Can access entities and records they have permission to view or modify based on your app’s configured access rules.
Service role: Can access all entities and records available to the app’s admin.
Retrieve data using get() for a single record, list() for all records, or filter() for records matching specific criteria.Use get() with a record ID to retrieve a specific record:
By default, data access is scoped to the current user’s permissions. With service role authentication, you can access data with admin-level permissions. This means you can access data that the admin role in your app has access to.Use base44.asServiceRole.entities to access data with admin permissions:
Copy
Ask AI
// User-level access (limited to current user's permissions)const myTasks = await base44.entities.Task.list();// Service role access (admin-level permissions)const allTasks = await base44.asServiceRole.entities.Task.list();