Skip to navigation

Dataset

Overview

Creates or finds a Supervisely dataset by name. If no matching dataset exists, the node creates it. The node requires a Supervisely project ID and a configured Supervisely secret with the server address and API token.

Supervisely project Supervisely dataset

Prerequisites

RequirementWhat you need
Supervisely credentialsAn existing supervisely secret with API access to the target team.
Target projectA project URL or ID, or a named flow so the project can be found or created from the flow name.

How it works

1

Resolves the project from Project URL or ID when one is given.

2

Otherwise resolves the team and its OvalBee workspace, then finds or creates a project named after the flow.

3

Searches that project for a dataset with the exact name.

4

Returns the first match, or creates the dataset, and publishes its ID, URL, preview, and item count.

FAQ

The node takes the first team on the account, uses its OvalBee workspace, and finds or creates a project named after the current flow. A flow without a name fails the run.

No. It returns the first dataset with that name and leaves its contents untouched.

Several datasets in the project share that exact name, so the first match was used. Give each dataset a unique name when the choice must be predictable.

The run fails before anything is created.

Inputs

Dataset name
stringRequired

Exact dataset name to find or create. Key: DATASET_NAME.

Supervisely credentials
secretRequired

Your Supervisely server address and API token, stored as a secret. Allowed credential types: supervisely. Key: SLY_SECRET.

Project URL or ID
string

Supervisely project the dataset belongs to, given as its URL or numeric ID. Leave empty to find or create a project named after the flow. Key: SLY_PROJECT_URL.

Workspace ID
integer

Supervisely workspace the project is looked up in. Leave empty to use the OvalBee workspace of the selected team, created when it is not there yet. Key: SLY_WORKSPACE_ID.

Team ID
integer

Supervisely team the workspace is looked up in. Leave empty to use the first team on your account. Key: SLY_TEAM_ID.

Outputs

Supervisely Dataset ID
integer

ID of the first existing dataset with the requested name, or the newly created dataset. Key: SLY_DATASET_ID.

Supervisely Dataset URL
string

URL of the existing or newly created Supervisely dataset. Key: SLY_DATASET_URL.

Items Count Str
string

String representation of the number of items in the dataset. Key: ITEMS_COUNT_STR.

Preview Image URL
string

URL of the preview image from the dataset Key: PREVIEW_IMAGE_URL.

JSON config

Machine-readable node interface for automation and advanced usage.

{
"name": "Dataset",
"description": "Finds the first Supervisely dataset with the specified name inside the project and returns it. If no dataset with that name exists, creates a new one.",
"category": "Supervisely",
"namespace": "supervisely",
"templateKey": "supervisely/dataset",
"version": "v1",
"inputs": [
{
"key": "DATASET_NAME",
"label": "Dataset name",
"type": "string",
"description": "Exact dataset name to find or create.",
"required": true,
"default": null,
"visibleWhen": null
},
{
"key": "SLY_SECRET",
"label": "Supervisely credentials",
"type": "secret",
"description": "Your Supervisely server address and API token, stored as a secret.",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"types": [
"supervisely"
]
}
},
{
"key": "SLY_PROJECT_URL",
"label": "Project URL or ID",
"type": "string",
"description": "Supervisely project the dataset belongs to, given as its URL or numeric ID. Leave empty to find or create a project named after the flow.\n",
"required": false,
"default": null,
"visibleWhen": null
},
{
"key": "SLY_WORKSPACE_ID",
"label": "Workspace ID",
"type": "number",
"description": "Supervisely workspace the project is looked up in. Leave empty to use the OvalBee workspace of the selected team, created when it is not there yet.\n",
"required": false,
"default": null,
"visibleWhen": null,
"options": {
"type": "integer"
}
},
{
"key": "SLY_TEAM_ID",
"label": "Team ID",
"type": "number",
"description": "Supervisely team the workspace is looked up in. Leave empty to use the first team on your account.\n",
"required": false,
"default": null,
"visibleWhen": null,
"options": {
"type": "integer"
}
}
],
"outputs": [
{
"key": "SLY_DATASET_ID",
"label": "Supervisely Dataset ID",
"type": "number",
"description": "ID of the first existing dataset with the requested name, or the newly created dataset.",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false,
"options": {
"type": "integer"
}
},
{
"key": "SLY_DATASET_URL",
"label": "Supervisely Dataset URL",
"type": "string",
"description": "URL of the existing or newly created Supervisely dataset.",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "ITEMS_COUNT_STR",
"label": "Items Count Str",
"type": "string",
"description": "String representation of the number of items in the dataset.",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "PREVIEW_IMAGE_URL",
"label": "Preview Image URL",
"type": "string",
"description": "URL of the preview image from the dataset",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false
}
],
"automation": {
"isolated": true,
"requires_configuration": true,
"discard_history": "on_success"
},
"widgets": {
"widget": {
"id": "image-preview",
"settings": {
"imageUrl": {
"type": "variable",
"value": "self.outputs.PREVIEW_IMAGE_URL"
},
"linkUrl": {
"type": "variable",
"value": "self.outputs.SLY_DATASET_URL"
},
"badge": {
"type": "variable",
"value": "self.outputs.ITEMS_COUNT_STR"
}
}
}
}
}