Data Sources
Add data from files or external sources, then chat with Plotly Studio to query and transform it to build your app.
Adding data
To get started, select + New project from the Projects page.

You can upload a file directly or use the chat to connect to an external data source.

Uploading a file or using sample data
Upload a CSV or Parquet file (up to 200 MB, with column headers in the first row), or select Try sample data to use a built-in dataset. Plotly Studio displays a preview of your data.

You can also view:
- Code - The Python code used to load your data
- Specification - A natural language description of how your data is loaded. This is useful for quickly understanding what the code does without reading Python.
- Logs - Any warnings or issues with loading your data
Once your data is loaded, you can query and transform it. See Querying and transforming data.
Tip
You can also ask the chat to generate sample data for your industry or use case (for example, "Create a sample dataset for a retail sales dashboard").
Connecting to external data sources
To connect to an external data source, for example, Snowflake, PostgreSQL, AWS S3, and more:
-
Request a connection in the chat by selecting one of the quick action buttons:

Or describe the data source you want to connect to. For example:
Connect to my PostgreSQL databaseConnect to my S3 bucketFetch data from the GitHub APISee Example connection requests for more examples.

Tip
If you need to start over, for example to change the data source, select Reset Conversation () in the top right corner of the chat.
The panel on the right includes tabs for:
- Preview - View your data once connected
- Code - The Python code used to connect to your data source. For external databases, the chat generates SQL and Python. For non-SQL data sources and static files, it generates Python.
- Specification - A natural language description of the code
- Credentials - Add the required credentials to connect to your data source
- Logs - View connection logs to troubleshoot issues
-
Select the Credentials tab, enter the required information for your data source, and select Save Credentials.

Note
When you add credentials, they are securely stored in your computer's keychain. When you publish your app, they are stored as secrets on Plotly Cloud or environment variables on Dash Enterprise.
Tip
Some data sources support multiple authentication methods. If the credential fields don't match your setup, ask in the chat for a different method (e.g., "Connect using an API key" or "Connect using username and password").
-
After entering your credentials, Plotly Studio automatically switches to the Preview tab.
- If you requested a specific table or file, your data displays immediately.
-
If not, you'll see a list of available tables, schemas, or files. Use the chat to specify which one to load:
Load the orders table from my database
Once you have the dataset you want to work with, you can query and transform it. See Querying and transforming data.
Example connection requests
Here are some common examples. Describe your data source in the chat and Plotly Studio will generate the connection code.
Connecting to a database:
Connect to my PostgreSQL database
Loading a specific table from a database:
Connect to my MySQL database
Show me the customers table
Loading data from cloud storage:
Connect to my S3 bucket and load the sales data CSV
Fetching data from an API:
Get daily high and low temperatures for New York for the past 30 days from the Open-Meteo API
Loading data from a public Google Sheet:
Load data from this Google Sheet (no API key required): https://docs.google.com/spreadsheets/d/your-sheet-id
Loading a file from a URL:
Load the CSV file from this URL: https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv
Joining data from multiple files (use the attachment icon in the chat to upload additional files):
Combine the contents of both output_001.csv and output_002.csv into a single output. The schemas are identical between them.
Querying and transforming data
Once your data is loaded, you can query and transform it through natural language in the data sources chat. Some common tasks include filtering rows, creating calculated columns, cleaning data, and aggregating and grouping.
Here are some examples with the built-in dataset:
Filtering:
Show only shipments with defects
Filter to show only items from the Osaka factory
Show shipments created in June 2022
Creating calculated columns:
Add a column for shipping days (difference between shipped_date and created_date)
Create a column for weight category: light if weight < 0.5, medium if 0.5-1.5, heavy if > 1.5
Add a column called 'delayed' showing if shipping took more than 30 days
Cleaning data:
Remove rows with missing delivery locations
Fill missing weight values with the average
Aggregating and grouping:
Count the number of shipments by factory location
Calculate average shipping days by delivery location
Tip
You can also use SQL queries directly to select and transform your data. For example: SELECT * FROM table_name LIMIT 20
Scheduling automatic data refresh
By default, data does not refresh automatically. You can configure your data to refresh on a schedule by asking in the chat, for example:
Refresh my data every hour
Update the data daily at 6am
Refresh the data every 30 minutes
Once your app is generated, you can manually refresh your data at any time by selecting the refresh button next to the Data Updated timestamp. This is available in the app preview in Plotly Studio and, if published, in the published app.

Note
Data can be refreshed at most once per minute.
Generating your app from a data source
As you query and transform your data, Plotly Studio saves versions as separate data sources. Use the dropdown to switch between versions.

When you're happy with your data, select Generate app to create your project.

This takes you to the Explore tab where you can generate charts from suggested prompts or write your own prompts to create charts from scratch.

Editing your data source
You can return to the Data tab at any time to modify your data source, queries, or transformations. Once you've made your changes, select Update app to apply them.

External data sources in published apps
When you connect to a data source using the Credentials tab, those credentials are securely stored as secrets on Plotly Cloud or environment variables on Dash Enterprise when you publish your app. When a user loads the app, it connects to your data source using these credentials.
Troubleshooting
If you encounter connection issues, check the Logs tab for error messages. Common issues include:
- Incorrect credentials - Go back to the Credentials tab to update your username, password, or access keys.
- Network connectivity - Ensure your data source is accessible from your network.
- Permission errors - Confirm your credentials have the necessary permissions.
Tip
If you encounter an issue, try asking in the chat for help. You can provide the error logs from the Logs tab, or ask the chat for the next step to resolve the problem.