Wyn Enterprise User Guide

Wyn Enterprise: Create a Push Dataset

The push dataset allows users to push the data for real-time data analysis. A push dataset stores this data in a new database and incrementally adds the new rows to the dataset. It is best suitable for analyzing long-term data trends with a strong sense of history. The dataset is updated each time you modify the data.

Unlike streaming datasets, push datasets have no expiry time. For more information on push datasets, refer to the following sections.

Push datasets can be used in both reports and dashboards.

To Create a Push Dataset

Use the below steps to create a push dataset on the Resource portal.

  1. On the Resource portal, navigate to the Create tab and then select Prepare Data for the report.

    Prepare Data for Reports

  2. To create a push dataset for the report, click the Create button as shown.

    Create Push Datasets

  3. In the Push Dataset Designer window that appears, fill in the following information for the field -

    • Name - Name of the field. It cannot start with a number, special character (like '<', '>', ':', '?', '*', '/', '|', '"', etc.) or a dot ('.')
    • Type - Data type for the field. It can be set to string, number, boolean, date, and datetime. By default, the data type for the field is set to 'String'.
    • Description - Additional information about the field. It is optional.

    Default view

    Note: Push dataset must contain at least one field.

  4. You can add more fields to the dataset using the + Add Field button as shown.

    Add fields to the push dataset

  5. Enter a valid string with a maximum length of 20 characters in the Push Data Token, or click the Random Generate button to generate a random data token. If you want only an authorized user should insert or clear the data in a push dataset, the value of the Push Data Token must be specified.
    Once the Push Data Token is set, you must add this token in the endpoint URL to add or clear data.

To Save a Push Dataset

Use the below steps to save a push dataset on the Resource portal.

  1. Click the Save button to save the push dataset. The dataset is now ready to be bound to reports.

    Save the dataset

  2. In the Save dialog box that appears, enter the dataset name, assign a category, and add a comment (if any) as shown.

    Save Dialog Box

    You can view the added dataset under the specified category in the Category tab of the Resource portal.

  3. Currently, the push dataset only defines the table structure. You can preview the dataset to view the table structure.

    Viewing Table Structure

    Since no data is pushed to the dataset, there are no rows added to the dataset. For more information on how to push data, see the below section.

To Push Data

Use the below steps to push data to the dataset on the Resource portal. In order to push data, you must specify the Push Data Token while creating the dataset. Push Data Token is a valid string with a maximum length of 20 characters. You must add this token in the endpoint URL to insert the data in a push dataset. This will make sure that only authorized users are able to add the data to the push dataset.

Also, the only way to insert data into the push dataset, is through API (JSON). In the below steps, we have used Postman, a great tool for sending API requests, for pushing the data to the dataset.

  1. On the Resource portal, go to Document Types > Dataset.

  2. Select the push dataset in which you want to insert the data.

  3. Click the More button and then select the Push Data Endpoint Information option from the list.

    Show Endpoint Information

    A Push Data Endpoint Information dialog box appears that provides information about the API request to insert data in the dataset such as End Point, Request body, and Information.

    Show Endpoint Information

  4. Copy the End Point from the Push Data Endpoint Information dialog box into the URL box of the Postman.

    Copy Endpoint to Postman

  5. Change the method type to 'POST'.

  6. In the Body tab of Postman, set the type to 'raw', and then specify the format as 'JSON'.

    Push Datasets

  7. Copy the Request body from the Push Data Endpoint Information dialog box into the body area of the Postman.

    The columns in the request body represent the names of the fields, while the rows represent the content of the fields. You can set overwrite to 'true' to overwrite the previous content, or 'false' to add the new content to the previous one.

    The below example uses the default values.

    Copy the Request Body to Postman

    If you want to add multiple rows, use an array as shown below.

    Add multiple rows to the dataset

  8. Now, click the Send button. You will see a success message on the successful addition of the data.

    Successful addition of data

  9. Preview the dataset to see the newly added data.

    Successful addition of data

To Clear Data

Based on your business requirement, you can delete the data you no longer require since the data in a push dataset keeps accumulating with time. In order to clear data, you must specify the Push Data Token while creating the dataset. Push Data Token is a valid string with a maximum length of 20 characters. You must add this token in the endpoint URL to clear the data in a push dataset. This will make sure that only authorized users are able to clear the data from the push dataset.

The only way to clear the data in a push dataset, is through API (JSON). In the below steps, we have used Postman, a great tool for sending API requests, for deleting the data from the dataset.

Have a look at the below push dataset. It contains the employee details such as the name, address, phone, and age. Let us suppose, you want to clear the data for those employees with ages greater than 30.

Sample Data in Push Dataset

  1. On the Resource portal, go to Document Types > Dataset.

  2. Select the push dataset from which you want to delete the data.

  3. Click the More button and then select the Clear Data Endpoint Information option from the list.

    Show Endpoint Information

    A Clear Data Endpoint Information dialog box appears that provides information about the API request to delete data in the dataset such as End Point, Request body, and Information.

    Show Endpoint Information

  4. Copy the End Point from the Clear Data Endpoint Information dialog box into the URL box of the Postman.

    Copy Endpoint to Postman

  5. Change the method type to 'DELETE'.

  6. In the Body tab of Postman, set the type to 'raw', and then specify the format as 'JSON'.

    Push Datasets

  7. Copy the Request body from the Clear Data Endpoint Information dialog box.

    copy the request body from the dialog box

    You can modify the copied request body based on your business requirements. Since we want to delete the employee details whose age is greater than 30. The request body will look as follows.

    Modified request body sample

    The option supports these three operators - '>', '<', and '='.

  8. Now, click the Send button. You will see a success message on the successful deletion of the data.

    Successful deletion of data

  9. Preview the dataset to see the pushed dataset.

    Final data

To Edit a Push Dataset

Editing a dataset includes adding new fields to the dataset, modifying or deleting the existing field names or types, and more. Use the below steps to edit a push dataset.

Note: Existing data is lost when you edit a push dataset.

  1. On the Resource portal, go to Document Types > Dataset.

  2. Select the push dataset that you want to edit.

  3. Click the More button and then select Edit from the list.

    Edit the dataset

  4. In the Push Dataset Designer window that appears, you can now edit the dataset. For example, you can click the Delete button to delete an existing field.

    Delete a field in the Push Dataset

  5. Once you finish modifying the dataset, click the Save button to save the changes.

  6. In the Save dialog box, click Save. Keep note of the caution message that appears while saving the dataset.

    Save Dialog box