Creating datapoints manually

The platform also allows you to create a Data Point manually. Tipically, datapoints are autogenerated once you sent your data to the platform. However, this article will focus on scenarios where you need to write the result of a Script or a Model execution in production mode with a Writer step.

Creating a data point

Before setting up your Pipeline with a writer step to store the response of a Script or a Model block in a datapoint, you may first need to create an empty datapoint and add it to a Template property list.

Following our example with the motor's bearings data sample, we will create a datapoint named output_dp that will later store the response from our custom pipeline Script/Model.

We will start by creating our data point. In the Data Hub menu, we will select Data Points and hit on the + Add button. This will open a box with some additional information. We will complete each row and click on Save.

Additionally, we can also create a datapoint via Python DSAPI, using the following logic:

datapoint = wizata_dsapi.DataPoint(
    hardware_id="output_dp",
    name="output_dp",
)
wizata_dsapi.api().create(datapoint)

If you don't know if your datapoint already exists or not, you can use the upsert_datapoint function to make sure that no property will be lost.

wizata_dsapi.api().upsert_datapoint(datapoint)

You will see your newly created datapoint on the datapoint list, but it will be empty. To map this datapoint, we need to create a template property.

We will cover everything you need to know about templates, template properties, and their usage on the platform in a separate article.


What’s Next