Page updated Jan 16, 2024

Data management

The Amplify Studio Data management view provides a tabular view of the backend data for an application. You can use this feature to test your models and to provide both technical and non-technical team members with the ability to create and update an application's data in real-time instead of building admin views.

Edit record form being shown in Data management page

The Data modeling documentation guides you through several examples for creating data models and setting the relationships between them. The following data management procedures, reference the Book and Author tables that were created in the data modeling example in order to demonstrate how to perform operations on your data.

To create data

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Content page, select the table to update from the Select table menu. For this example, select the Author table.
  4. Choose Create author.
  5. In the Add Author window, specify your custom values for the fields in the table. For this example, enter Martha for the firstName field and enter Riviera for the lastName field.
  6. Choose Submit.

To seed data

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Content page, select the table to update from the Select table menu. For this example, select the Author table.
  4. On the Actions menu, choose Auto-generate data.
  5. In the Auto-generate data window, specify how many rows of data you want to generate and constraints for the generated data.
  6. Choose Generate data. Seed data is auto-generated using Faker.

Warning - Seed data cannot be generated for tables that have the following field types: AWSPhone, Enum, Custom Type, or Relationship

To edit data

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Content page, select the table to update from the Select table menu. For this example, select the Author table that you used in the previous procedure.
  4. From the list of records, select any field in the record you want to update.
  5. In the Edit Author window, make any changes to your record, and then choose Submit.

When you create a new instance in a table, you can also link it to an instance in another table based on the relationships between the data models.

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Content page, select the table to update from the Select table menu. For this example, select the Book table, to add a new instance of a book.
  4. Choose Create book. For title, enter All About Dogs.
  5. Let's link this book to the Martha Rivera author instance that you edited in the previous procedure. Choose Link to an existing Author, then choose the ID for Martha Rivera from the list of Author instances. Note that you have the option to link to an an author because a relationship was defined between the Book and Author tables during the data modeling process.
  6. View the details for the All About Dogs instance in the Book table, and Martha Rivera is linked as an author.

Alternatively, you can save save All About Dogs before linking to an Author, and instead create the link from an Author record by opening the Martha Rivera record, and selecting All About Dogs from the related Books.

To delete data

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Content page, select the table to update from the Select table menu. For this example, select the Author table that you used in the previous procedure.
  4. From the list of records in the table, select the checkbox to the left of the record(s) you want to delete. For this example, select Martha Rivera.
  5. On the Actions menu, then choose Delete.
  6. In the Delete item confirmation window, choose Delete.

To download data

  1. Launch Studio for an app.
  2. On the Manage menu, choose Content.
  3. On the Actions menu you have two options for downloading data.
  4. Choose Download selected items (.csv) to download only the selected rows of data.
  5. Choose Download all items (.csv) to download all rows of data on the currently selected model.
  6. Once you have selected a download option, your data should immediately start downloading as a CSV.

Limitations

Conflict Resolution and DataStore

Studio's Data Manager supports Amplify GraphQL APIs with and without DataStore. However, GraphQL APIs without DataStore have several minor limitations:

  • Data cannot be sorted by column
  • The search bar is disabled

To use these features, you can add DataStore to your app by adjusting your Conflict Resolution settings.

If your GraphQL API is using Conflict Resolution and DataStore

Multi-tab limitation

If your GraphQL API is using DataStore, Studio's Data Manager requires use of IndexedDB (a local database in your web browser) in order to function. Because of this, Data Manager may not load as expected if opened in multiple tabs or windows in your browser.

This limitation does not apply to GraphQL APIs with Conflict Resolution disabled.

Null required fields

When using the data manager, you may encounter the following error message:

1Field {{fieldName}} cannot be set to null since it's a required field.

This message occurs when there are records in the selected data model that have null values for required fields. Usually, this occurs because a field was changed to be required after records were created. To resolve this issue, null records need to be updated.

To update records in Studio...

  1. From the Data tab, change the required field to optional, and select Save and deploy to redeploy your data model
  2. In the Content tab, update all records so that there are no null values for this field, or delete records with null values
  3. In the Data tab, change the field back to required, and select Save and deploy again

To update records in DynamoDB...

  1. Visit the DynamoDB console
  2. Select the Tables heading in the left-hand nav bar, and select your app's table
  3. Select the "Explore table items" button in the upper right-hand corner
  4. Update all records so that there are no null values for this field, or delete records with null values

Bi-directionally required fields

A bi-directionally required field is a Relationship field between two data models where both models require a non-null value for the field. Currently, the Data Manager does not support creating or editing records for models with bi-directionally required fields. To manage data in these models, take one of two paths:

  1. Change the field to optional for one or both of the related models, OR
  2. Create and manage records using GraphiQL, which supports simultaneous record management

Change of type in fields

When using the data manager, you may encounter the following error message:

1Field {{fieldName}} has a type mismatch. Expected {{typeName}}, but got {{typeName}}

This message occurs when there are records in the selected data model that have a mismatch in the expected type of a field. Usually, this occurs because a field was updated with a new type after records were created. To resolve this issue, records need to be updated.

To update records in Studio...

  1. In the Content tab, update all records so that they match the type of this field

To update records in DynamoDB...

  1. Visit the DynamoDB console
  2. Select the Tables heading in the left-hand nav bar, and select your app's table
  3. Select the "Explore table items" button in the upper right-hand corner
  4. Update all records so that they match the type of this field

IAM required as auth provider

In order to use Data Manager, your app must have IAM set as the default or an additional auth provider. If IAM is not added as an auth provider, you may receive the following error message:

IAM is required as an auth provider to use content management capabilities. To automatically add IAM and enable content management, navigate to ‘Data’ and select ‘Save and Deploy’.

For Studio-supported GraphQL schemas...

  1. Navigate to the Data tab
  2. Click "Save and Deploy" and Studio will automatically add IAM as an additional auth provider

For unsupported GraphQL schemas...

  1. In your app root directory, run amplify update api
  2. Select GraphQL
  3. Select Authorization Modes
  4. Change your default auth type OR add an additional auth type

Change your default auth type:

  1. Select IAM as your default authorization type
  2. Run amplify push

Add an additional auth type:

  1. Select your current default authorization type and accept all defaults to leave it unchanged
  2. Select Configure additional auth types
  3. Select IAM
  4. Run amplify push