---
title: "How to extract data from the platform to Orange3?"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220825579/How%20to%20extract%20data%20from%20the%20platform%20to%20Orange3%3F"
format: markdown
---
> Macro (toc)

## Intro

In this tutorial, we will explain how to make a data request to the platform. To follow the tutorial, you must have installed the add-on as explained in [How to install Onesait Platform's add-on for Orange3?](https://onesaitplatform.atlassian.net/wiki/spaces/DOCT/pages/2220825473).

The used workflow is in the /examples folder, named Example_01.ows.

Firstly, load the tutorial or drag the nodes to the main screen until you get the following workflow:

![image](media://7729e6f4-c8c1-4c54-936d-335c12e26cdd)

This node represents a platform client through which the connection parameters are inserted. The combination between clients and operations (query and insert) can be freely made using different clients or platforms.

![image](media://ff44ee5c-7bb5-4cec-8810-a9d01ac3b259)

## Query

The query node is used to make a data request to the platform. It must be connected to a client that sends the needed credentials.

This node receives the platform's data formatted in json, depending on the query that was made (It supports SQL and NATIVE queries); this is why it is commonly connected to a Flat Data or Python Script node to properly format the data.

![image](media://a17a13a0-b7d8-4a38-90e2-b2362f61ec7a)

To ease the data format, you have the Flat Data node, which depends on the query execution way to transform the data to an Orange Table.

## Flat Data

This node transforms the obtained data from JSON format to Orange Table format. It depends greatly on the query's results from the previous node. This means that doing the query in the right order is essential to flatten the data.

![image](media://0e4e73f6-cbf7-4ee2-aee2-c2ccba529289)

Once the nodes are launched, the data are provided in table format, ready to be used by Orange3's other components.

You can also launch the nodes automatically whenever a change is detected in the previous ones, or manually. This is done with buttons like.

![image](media://b4895432-3ccc-47fe-bfb2-4ccf006f3b5b)

## Insert

Although the Example_01.ows example tutorial does not make an insertion, this tutorial will also explain the Insert node.

The Insert node must be connected to a client and to a node that outputs a json-format instance list (objects with an ontology scheme where the ontology is the ontology where you want to insert). It must also receive the ontology as a parameter.

This node is almost always connected to a Python Script node, because it must convert from Orange Table format to JSON format with the transformation requested by each user.

![image](media://f49972aa-b685-4275-86b1-1c4e0b1f2e56)

You can see how the Query node's option is valid as an input for the Insert node (JSON format). In this case, it is connected to the previous client, but you could use another different client (different credentials, ontology or platform installation).