With this PowerShell script, data can be retrieved from various data sources and uploaded to d.velop business objects.
It does not create a model and it's entity types, these have to be created manually either via the admin user interface, an HTTP request or any other viable method.
This step-by-step guide will show you how to run a simple hello world like demo of this script on your computer. If you run into issues, check the prerequisites below.
-
Download the release zip archive
dvelop-bo-toolkit-release-vx.x.x.zip
from the release section and extract it or clone this repository by executinggit clone https://github.com/d-velop/dvelop-bo-toolkit.git
-
Go to the
business_objects_upload
sub folder -
Configure the following model and entity type in business objects by using one of following alternatives.
Alternative 1: Use the business objects admin user interface available at
https://<your-tenant-name>.d-velop.cloud/businessobjects/admin/models
:- Create model with name:
ERP_Data
in initial state - In that model create an entity type with the following properties
- Name:
Supplier
- Plural name:
Suppliers
- Key property name
SupplierNo
and typeint32
- Additional property
Name
and typestring
- Additional property
City
and typestring
- Name:
- Stage the model
- Publish the model
Alternative 2: Use this Postman collection. After you configured it, execute the following requests:
- Model Configuration/Routine/new model erp data (Creates the model)
- Model Configuration/Routine/new entity type supplier (Creates the supplier entity type)
- Model Configuration/Routine/model erp data state = published (Publishes the model)
- Create model with name:
-
Generate a d.velop cloud API key on the configuration page of the identity provider app available at
https://<your-tenant-name>.d-velop.cloud/identityprovider/config/apikey
-
Next you need to edit the config file that defines the import process:
- Open the configuration file in this directory named
ScriptConfig.json
in an editor of your choice - Set the value of
baseUri
to your base URI. It usually has the following structurehttps://<your-tenant-name>.d-velop.cloud
- Enter the generated API key in the
apiKey
property
- Open the configuration file in this directory named
-
Now you can start the script and 30 suppliers from the
suppliers.csv
file located in this directory will be uploaded to business objects
After the first import runs successfully, the script waits 600 seconds (10 minutes) and runs the import again.
To end the script you can simply press CTRL+C
or close the window.
- How to use and configure the script to your needs can be found on the CONFIGURATION page.
- This repository also provides example script configurations for imports from a MSSQL and Oracle DB data source.
- PowerShell version >= 5.1 is installed
- You may encounter errors if the execution of PowerShell scripts is not allowed. This can be configured using
Set-ExecutionPolicy RemoteSigned
, for more information see the PowerShell docs on this topic - d.velop business objects is subscribed in the d.velop cloud tenant
- A business objects model and an entity type are configured. To learn how to achieve this, see the Postman collection (can be downloaded as a separate archive from the Releases section, where this archive was also downloaded)
- An API key for a user with the following permissions was generated in the IDP app configuration (and is configured in the config json):
- Query data
- Deliver data
- If the data source is a SQL database:
- Database connection information are available (read access)
- SQL Query to request the relevant data from the database is created
Not all data types supported by business objects are currently supported by the upload script. The supported and unsupported data types are broken down in more detail below.
The following data types can be used for the key property of an entity type:
- guid
- int32
- int64
- string
The following types are supported for the properties of an entity type:
- boolean
- dateTimeOffSet
- double
- guid
- int16
- int32
- int64
- date
- string
However, the following data types are not currently supported:
- binary
- byte
- list<string>
- decimal
- sByte
- single
Notes
.
must be used as a decimal separator in CSV files- Values of type
date
must be in the formatyyyy-MM-dd
, e.g.2013-07-05
dateTimeOffset
values must be in the formatyyyy-MM-ddTHH:mm:ssZ
, e.g.2013-07-05T00:00:00Z
- The PowerShell script only communicates with the d.velop service business objects and, if configured, a database to perform the import.
- Besides the config json and the CSV file (if configured) it does not access any files on your computer.
- If configured it also creates and deletes log files, but these are the only files this script creates and/or deletes.
Additional information can be found in the d.velop business objects API Guide.