content/shared/influxdb-v2/tools/notebooks/create-notebook.md
Create a notebook to explore, visualize, and process your data. Learn how to add and configure cells to customize your notebook. To learn the benefits and concepts of notebooks, see Overview of Notebooks.
To create a new notebook, do the following:
In the navigation menu on the left, click Notebooks.
{{< nav-icon "notebooks" >}}
In the Notebooks page, select one of the following options under Create a Notebook:
Enter a name for your notebook in the Untitled Notebook field.
Do the following at the top of the page:
Your notebook should have a Data Source cell as the first cell. Data Source cells provide data to subsequent cells. The presets (listed in step 2) include either a Query Builder or a Flux Script as the first cell.
To define your data source query, do one of the following:
Select and click Preview (or press CTRL + Enter) under the notebook title. InfluxDB displays query results in Validate the Data and Visualize the Result without writing data or running actions. {{% /show-in %}}
(Optional) Change your visualization settings with the drop-down menu and the {{< icon "gear" >}} Configure button at the top of the Visualize the Result cell.
(Optional) Toggle the Presentation switch to display visualization cells and hide all other cells.
(Optional) Configure notebook actions {{% show-in "v2" %}}(Alert, Task, or Output to Bucket){{% /show-in %}}{{% show-in "cloud,cloud-serverless" %}}(Alert or Task){{% /show-in %}}.
(Optional) To run your notebook actions, select and click Run under the notebook title.
(Optional) To add a new cell, follow the steps for one of the cell types:
(Optional) Convert a query builder cell into raw Flux script to view and edit the code.
To edit the raw Flux script of a Query Builder cell, convert the cell to Flux.
{{% warn %}} You can't convert a Flux Script editor cell to a Query Builder cell. Once you convert a Query Builder cell to a Flux Script editor cell, you can't convert it back. {{% /warn %}}
Click the {{% icon "more" %}} icon in the Query Builder cell you want to edit as Flux, and then select Convert to |> Flux. You won't be able to undo this step.
A Flux Script editor cell containing the raw Flux script replaces the Query Builder cell.
View and edit the Flux script as needed.
Add a data source cell to pull information into your notebook.
To add a data source cell, do the following:
A validation cell uses the Table visualization type to display query results from a data source cell.
To add a Table visualization cell, do the following:
Add a visualization cell to render query results as a Visualization type.
To add a Table visualization cell, do the following:
Click {{< icon "notebook-add-cell" >}}.
Under Visualization, select one of the following visualization cell-types:
To modify a visualization cell, see use visualization cells. For detail on available visualization types and how to use them, see Visualization types.
Add an action cell to create an alert {{% show-in "cloud,cloud-serverless" %}}or{{% /show-in %}}{{% show-in "v2" %}},{{% /show-in %}} process data with a task {{% show-in "v2" %}}, or output data to a bucket{{% /show-in %}}.
{{% show-in "v2" %}}
{{% warn %}}
If your cell contains a custom script that uses any output function to write data to InfluxDB (for example: the to() function) or sends data to a third-party service, clicking Preview will write data.
{{% /warn %}}
{{% /show-in %}}
To add an alert to your notebook, do the following:
${strings.title(v: r._type)} for ${r._source_measurement} triggered at ${time(v: r._source_timestamp)}!
{{% show-in "v2" %}}
To write Data Source results to a bucket, do the following:
{{% /show-in %}}
To add a task to your notebook, do the following: