Skip to main content

Update data & models

As of now we are ready to explore some core functionality of dcupl. Let`s try some basic changes in the model definitions and the data files to get our feet wet.

Step 1 - update the data

info

dcupl is able to process JSON and CSV datasets. It does not matter if they are static or fetched via an API.

Open your local workspace in your preferred editor (we recommend Visual Studio Code) and check out the file /dcupl/data/a.data.json.

Getting Started - Playground Step 1

In this setup we are using a simple JSON data structure to describe some todo's.

Any update of this file should be reflected automatically in the Data Explorer. Make sure you have the source dcupl CLI / Localhost selected in the Console.

{
"key": "step-1",
"todo": "Todo: You can update this dataset in 'data/a.data.json'",
"title": "dcupl is awesome"
},

Getting Started - Playground Step 1 - Show updated Data in Data Explorer

Step 2 - update a model

Initially not all of the data in the JSON resource is shown in the Data Explorer - subtitle is still missing. The reason for that is, that subtitle is not defined as a property for "modelA". Open the file dcupl/models/a.dcupl.json in order to add the new property.

tip

If you use Visual Studio Code you will be supported by some cool autocomplete features.

Getting Started - Playground Step 2 - VS Code Plugin

Add the property subtitle and hit save - the new property should now be visible in the Data Explorer.

{
"key": "modelA",
"properties": [
{
"key": "todo",
"type": "string"
},
{
"key": "title",
"type": "string",
"filter": true
},
{
"key": "subtitle",
"type": "string"
}
]
}
info

dcupl combines the model definitions and it's corresponding data sources to create a stable backbone for your application. Only properties, that are defined in your model, are interpreted in dcupl. This makes working with dcupl very easy to understand and very predictable. That's why you only see the subtitle property after declaring it as a property in the model.

Step 3 - Simple integration

In the next step we do a simple integration of your dcupl workspace in an application using our SDK.