Bulk Upload Setup Tutorial using CSV Files

Bulk Upload Setup Tutorial using CSV Files

This tutorial will guide you through setting up an Analysis and Dashboard on the TagoIO Platform to enable bulk uploading of CSV files for creating multiple devices simultaneously.

By following these steps, you will achieve:
  • A Dashboard to upload CSV files.
  • An Analysis that handles device creation.
  • A Dummy Device to work with dashboard widgets and store error information.


Prerequisites

  • Access to the TagoIO Platform.
  • Basic understanding of TagoIO components: Devices, Analysis, Actions, Dashboards.


Step 1: Create a Dummy Device

A device is required to store your data and interact with the dashboard widgets.

  1. Navigate to Devices:
    1. Go to https://admin.tago.io/devices.
  2. Add a New Device:
    1. Click the “Add device” button located at the top right corner.
  3. Select Connector:
    1. Choose the “Database” connector and click on it.
  4. Name Your Device:
    1. Provide a name for your device and click Create.
  5. Device Confirmation:
    1. You will be redirected to the device's detail page.


Step 2: Setting Up the Analysis

The Analysis processes the CSV data to create devices automatically.

  1. Access the Analysis Template:
    1. Visit Analysis Template.
  2. Configure the Analysis:
    1. Clone the Template: Click on “Install Template” to clone the code to your own Analysis.


Step 3: Configuring Access Policies

Instead of using a Profile Token, you will now configure Access Policies to grant necessary permissions for device creation.
  1. Navigate to Access:
    1. Click on the Access button in the sidebar.
  2. Add a New Policy:
    1. Click the “+ Add Policy” button.
  3. Select the Target:
    1. Choose your imported Analysis as the target for the policy.
  4. Set Permissions:
    1. Add a new Permission for Devices with the following rules:
      1. Access
      2. Create
      3. Edit
    2. Add a new Permission for Services with the following rules:
      1. Create Profile Notification
    3. Set Field to Any
  5. Save the Policy:
    1. Click Save to apply the new access policy.


Step 4: Setting up the Dashboard

The Dashboard provides a user interface to upload CSV files and manage devices.

  1. Access the Dashboard Template:
    1. Go to Dashboard Template.
  2. Clone the Dashboard:
    1. Click on “Install Template” to create your own Dashboard.
  3. Select the Device:
    1. Choose the device you created earlier when prompted.
  4. Select the Analysis:
    1. Choose the Analysis you imported earlier when prompted.
  5. Save Configuration:
    1. Save your changes to finalize the Dashboard setup


Step 5: Preparing the CSV File

Your CSV file should contain the necessary information to create devices. An example file is available for download.

  1. Download Example CSV:
    1. Example CSV File.
  2. CSV Structure:
    1. Device Name: The name of the device.
    2. Device Serial: Represents the EUI or ID, depending on your network. Do not change the CSV header.
    3. Data Retention Value: Specify as forever, 1 day, 1 month, or 1 year.
  3. Customize Your CSV:
    1. Populate the CSV with your device details following the structure above.

Example:
  1. devicename,deviceserial,devicetype,chunkperiod,chunkretention
  2. MyDevice,123,mutable,,
  3. MyDevice2,123,immutable,day,2
  4. MyDevice3,123,immutable,week,5
  5. MyDevice4,123,immutable,month,1
  6. MyDevice5,123,immutable,quarter,4


Using the dashboard

Interact with the Dashboard to upload your CSV and create devices.

  1. Access the Dashboard:
    1. Open your configured Dashboard on TagoIO.
  2. Download CSV (Optional):
    1. Use the provided link to download the example CSV if needed.
  3. Upload CSV File:
    1. Follow the on-screen instructions within the Dashboard to obtain your network and connector ID.
  4. Create Devices:
    1. Ensure you are uploading one type of device per CSV file (e.g., HTTP or MQTT).
    2. Press the “Create Devices” button to initiate the bulk upload.
  5. Verify Creation:
    1. Check for any errors returned by the widget as feedback.
    2. Confirm that the devices have been created successfully in your TagoIO account.

Troubleshooting

  • Access Issues: Ensure that your Access Policies are correctly configured to allow device creation.
  • CSV Errors: Verify that your CSV file follows the required structure and contains all necessary fields.
  • Widget Configuration: Double-check that the widget is correctly linked to the Analysis and that the Analysis has the appropriate permissions.
For further assistance, feel free to comment on this topic!