Creating a new Notebook Entry containing Results
Overview
In this guide, we'll go through the steps necessary to create a new notebook Entry (using the SDK) that is pre-populated with assay results. If you'd like to add results to an existing Entry, please refer to Uploading Results to Benchling through the API.
We'll use an Entry Template containing a results table as the basis for our new Entry, and we'll add our results to this table via a CSV file. Here's what our empty Entry Template looks like:

Fetch the Entry Template
Let's start by fetching the Entry Template that we want to use to create our entry. To do this, we'll use the ID of the Entry Template, which you can find via Benchling (Feature settings > Template collections) and using the 'Copy API ID' button:

Now we have the Entry Template ID, we can retrieve the template using the SDK.
import os
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.api_key_auth import ApiKeyAuth
benchling = Benchling(url = "https://TENANT_NAME.benchling.com", auth_method=ApiKeyAuth(os.environ['BENCHLING_API_KEY']))
template = benchling.entries.get_entry_template_by_id(entry_template_id="tmpl_XXXXXX")
print(template.to_dict())
To create results within our entry, we'll need to use:
- the ID of the table in the template - this will be used to associate our results with the correct table in the Entry
- the IDs of the columns - these will be used in our CSV in place of traditional column headers (
Plate Well
andValue
in our example)

Storing and Re-using IDs
Once the design of the Entry Template is final, there's no need to fetch the IDs for the template table or the column IDs every time you make a new Entry from this template. Instead, we'd recommend storing these as fields in App Configuration. For more information, see Building your first App with App Configuration.
Create CSV File and Upload as Blob
Now we have the column identifiers, we're ready to create our CSV file. The first column represents our Plate Well positions, and the second column the result values we'd like to associate with these wells.
fb8590a2-9c12-42ab-b96d-54f596142715,b105c438-6639-469e-ae28-4ad162daf47e
96WP001:A1,1.2345
96WP001:A2,2.3456
We can now upload this file as a blob to Benchling:
from pathlib import Path
from benchling_sdk.models import BlobCreate
blob = benchling.blobs.create_from_file(
file_path=Path("Plate Results.csv"),
name = "Plate Results.csv",
mime_type="text/csv",
)
csv_blob = blob.id
Create the Entry
We now have all the pieces we need to create the new Entry in Benchling. We'll define our table as an InitialTable
, which associates our blob with the ID of the table in the template. To construct the Entry, we'll create an instance ofEntryCreate
and also provide:
- a folder ID: where the entry should be created within Benchling
- a name: the name for the new entry that will appear within Benchling
- the Entry Template ID: we'll re-use the value from the first step
from benchling_sdk.models import EntryCreate, InitialTable
table = InitialTable(
csv_data = blob.id,
template_table_id = "strtbl_XXXXXX",
)
entry = EntryCreate(
folder_id = "lib_XXXXXX",
name = "Create Entry w Results",
entry_template_id = template.id,
initial_tables = [table],
)
created_entry = benchling.entries.create_entry(entry=entry)
The entry will be created within Benchling, and contain the results we added to the CSV in the correct place:

Updated 1 day ago