Datasources in APPS provide various ways to integrate data to your app. In this article we will focus on how to integrate data from different sources to an app by looking at some examples for each possibility.

More information about datasources in general can be found in the respective article.


Integrate Filterable Result Tables

There are several ways to integrate data from ONE DATA workflows into your app, and one of them is using Filterable Result Tables. 

First of all, we need a workflow that contains a FRT. In this example, we load a dataset with the Data Table Load Processor, then execute a Query on it and save the results to a FRT.


After the workflow has been successfully executed, we need to open the configuration of the FRT, and navigate to the "Json Result" tab. There we can find the "filterableResultTableId" that we will need in the next step. In this example we copied it and inserted it to the name of the FRT, to be able to access it faster, but this is not necessary.


Note that the frtId changes every time the workflow is run!


Now we need to specify the datasource that references the FRT within Apps.

  "datasources": [
    {
      "id": "frtDataSource"
       // as origin frt must be set
      "origin": "frt",
      "config": {
         // the schema needs to be table
        "schema": "table"
         // here we insert the filterableResultTableId
        "frtId": "b782551c-d08a-4f1f-99e9-f05ef6ad61e4"
      }
    }
  ]



Integrate Data Tables

It is also possible to directly integrate data from standard OD Data Tables to your app.

Similar to integrating a FRT, we first need the id of the data table we want to use. This can for example be achieved by using a Data Table Load Processor. Within the processor configuration, select the data table you want to use, and copy the displayed id.


The datasource configuration within APPs:

  "datasources": [
    {
      "id": "dataSetSource",
      // as origin dataset must be set
      "origin": "dataset",
      "config": {
        // the schema needs to be table
        "schema": "table",
        // here we insert the datasetId
        "datasetId": "0d8b0824-c20e-435d-ac8c-0bb393e6f90e"
      }
    }
  ]


Integrate Job Result Tables

Another way to integrate data from OD workflows to your app is using workflow job Result Tables.

First of all, we need a workflow that contains at least one Result Table, that we want to display in the app.

In this example we just take the workflow used in the first section and replace the FRT with a Result Table.


Then, you need to select the job which results you want to display. This can be achieved by clicking "Show Jobs" on the left toolbar of the page. In this example we select the latest job.


For the integration of job data in an app, we need to specify three ids within the datasource configuration in Apps:

  • Workflow Id
  • Job Id
  • Result Id

The first two ids can be found in the URL of the workflow edit page, which has the following structure when a workflow was run or a job selected:

https://.../onedata/workflow/[workflowId]?versionNumber=1&jobId=[jobId]

 For our example, it looks like this:



Last but not least, we need the result id, which can be found in the configuration of the Result Table under the tab "JSON Result". There, it is saved as the property "processorRunTimeId":


Now we can combine the ids within the Apps Datasource:

  "datasources": [
    {
      "id": "jobResultSource",
      // as origin, job must be set
      "origin": "job",
      "config": {
        // the schema needs to be table
        "schema": "table",
        // here we insert the the ids of workflow, job and result
        "workflowId": "3ee761f5-12b3-445c-8f4f-92fbc8e3da44",
        "workflowJobId": "2067abeb-ceed-4c98-b9a2-346aaf35952d",
        "resultId": "587724b4-3573-4745-97f5-ac8b0b2cba98"
      }
    }
  ]