The Data Table block is a data workflow block that enables data editing in the both the preparation phase and the Report app. This functionality can enable both report creator and the report viewer to make manual corrections or add comments to the dataset.


The Data Table block is typically connected to the report, where data can easily be explored and corrected if necessary, but, as we will show in this article, it can also be useful when connected to other data operations blocks.


In essence, the Data table block is representing a data container which can be edited, and ‘refilled’ with data from other blocks. 


To add a Data Table block simply click on the add block button or drag it to the workflow position.


   


By clicking on this block in the workflow the block will open displaying an empty table: by default it has an 8x50 empty table. It is possible to edit the data by double-clicking a cell and entering the text.


After the data inside the Data table block has been edited a pen icon will appear next to the block to reflect the change:

                                                         

To fill the Data table block with the data from another block, simply connect them and click the Refresh button. This operation will load the entirety of the upstream data, and will disregard any edits done previously in the Data table. 


Note that to refill the data table block it is necessary to click on refresh from source: a normal workflow execution (i.e., clicking the play button) will not refill the table.



     

When the execution is complete, the new data can be examined in the block preview tab.


     

Important: You can toggle the ability to edit data in the Data table block by ticking the “editable” checkbox in the options tab. The data will still be refilled from upstream even if the editable checkbox is disabled.


     

The data will still be reloaded when refreshing from source.



By connecting the Data table block directly to a Report block, it is possible to query the data in the table using any combination of views and filters, and edit the data using the Table View. Data edits made in the Table view will be reflected in other views .


       

The Data table block can also participate in any workflow execution, and it will provide the records contained in its table to downstream blocks: the records will reflect any edits that have been made (in the workflow block or the Report table).


Note that the Data table block will not behave as all the other blocks during execution: it will not necessarily read the data from upstream blocks, instead it will provide the records that are contained in its table.  In this regard the block behaves as a snapshot of data that can be edited in multiple locations (to load the upstream records into the Data table block you will need to select the block and click on refresh from source: this action will discard any manual edits).


Data Table Block and workflow execution APIs: an example


We can leverage the Workflow execution APIs with the functionality provided by the Data table block. In this section we will explore how to create an Omniscope project whose report allows the user to visualise, edit and publish the data onto an external system, all within the report app.


You can find more information about workflow execution apis here: https://help.visokio.com/support/solutions/articles/42000073133-workflow-execution-rest-apis .



Here is a simple example: the Data table block is loaded with the records coming from a database table, and it is connected to the Report block and a Database publisher block. The goal is to be able to explore and edit the data using the report app and being able to publish the table back to a database table (either the same table as the source, or a different table), all without leaving the report app. 


       


In the report we added the Workflow Execution custom view from the community developed custom views, and configured it so as to execute the Database output block (without refreshing from source):


       



The data can be edited in a Table view (via a double click on a cell):


       

It is possible to check the process is working as intended by pinning the report (pin button from the 3 dot menu inside the Report), and clicking on the Publish Data button, to view the data flowing between the blocks:



N.B. It is important to disable refresh from source, otherwise the data inside the data table block will be overwritten with the data coming from upstream (Database input block in this example), discarding any edits.


A similar example, using files instead of database tables, is available for download at the end of this article.


Shared report editor permission

In shared reports you can control the ability to edit a Data table block via the Shared report editor permission. You can configure it in the Admin app. For more information about permissions see: https://help.visokio.com/support/solutions/articles/42000036489-server-permissioning


       


N.B.

Editing is always disabled when visualising a multi tenant report: https://help.visokio.com/support/solutions/articles/42000067091-multitenant-reports