Changes

Jump to: navigation, search

Automate Update data

388 bytes added, 17:24, 18 October 2016
Marked this version for translation
<translate>
<!--T:1-->== '''Data Import automation on TaticView''' ==<!--T:1-->
<!--T:2-->
You can automate the data import of your Data Files.
<!--T:3-->
Some setup procedures and the use of TVcli command line program are necessary to automate imports on TavicView.
<!--T:4-->
If you are having trouble, open a support ticket on https://support.taticview.com/open.php. We are glad to help you.
=== Installing TVcli ===<!--T:5-->
<!--T:6-->
First download the installer:
* +Windows+
* +Mac-OS+
<!--T:7-->
Then run the installation on the same workstation where the files that are going to be automatically imported are.
=== ACCESS TOKEN generation ===<!--T:8-->
<!--T:9-->
You must have an '''ACCESS TOKEN''' registered on TaticView and TVcli before you can run an automation import.
An ACCESS TOKEN is always related with a TaticView user.
It can be revoked by you at any time, allowing you to decide who and when can access your account on TaticView.
<!--T:10-->
You can generate the ACCESS TOKEN in two ways:
<!--T:11-->
'''Through TVcli'''
# Run the command through command line requesting the generation of a new ACCESS TOKEN.
<!--T:12-->'''Syntax: tvcli -cmd get_token_by_password -user <user name> -password <user password> [-token_name "<token name>"]'''
<!--T:13-->-cmd - get_token_by_password - Requests and stores the ACCESS TOKEN through command line. (TVcli)
-user - TaticView user
-password - TaticView password
-token_name (optional) - The name that you want to give to the access token. Default name "TaticView CLI"
<!--T:14-->'''Example: tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVcli Server 1"'''
<!--T:15-->
'''Through TacticView interface'''
# Identify yourself on TaticView and access the '''My account''' button '''ACCESS TOKENS''';
# Run TVcli informing the generated ACCESS TOKEN
<!--T:16-->'''Syntax: tvcli -cmd store_token -user <user name> -token <generated token>'''
<!--T:17-->-cmd - store_token - stores token generated through the interface
-user - TaticView user
-token - The token generated through the interface
<!--T:18-->'''Example: tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5'''
=== Importing in an automated way ===<!--T:19-->
<!--T:20-->
You can only automate the import of data files that have been already created on TaticView, so you are going to need at least one manual import to create the necessary structure.
Then you must grant the automatic import to the desired data file..
To do this click on the imported file (On the TaticView interface), select '''Properties''', and check the checkbox '''Automatic Importation''', which displays the identifier code of your data file, as you can see in the example below:
<!--T:21-->
!datamart-dropdown.png!
<!--T:22-->
!automatic-importation.png!.
<!--T:23-->
Once the data file is imported, granted for automatic import and you have your identification code, you can run the import through the command line.
<!--T:24-->'''Syntax: tvcli -cmd import_file -user <user name> -datamart <identifier> -file "<file/spreadsheet>" [-type <type>] [-wait] [-noerror] -[notifyshare]'''
<!--T:25-->-cmd - import_file - uploads the data file and places it in the import queue
-user - TaticView user
-datamart - identifier of the data file obtained in the Data file properties at the interface.
-notifyshare (opcinal) - sends data update notification to users who have these data file dashboards shared when the importing process ends without errors.
<!--T:26-->'''Example:'''
'''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx"'''
'''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\file.csv" -notifyshare'''
=== Command return test ===<!--T:27-->
<!--T:28-->
The TVCI executable returns different codes to report the success or failure during the execution process.
<!--T:29-->'''0 - Success'''
'''8 - Error'''
<!--T:30-->
A notification is sent to the user if an error occurs during the import process.
A log with the imports details is generated in the logs directory, below the directory where TVcli was installed.
<!--T:31-->
An example of Windows running script:
<!--T:32-->'''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx" -notifyshare'''
'''if errorlevel <> 0'''
'''Error notification by email'''
<!--T:33-->
<span style="color: red;">'''Important'''</span>
<!--T:34-->
The free version grants you automation import from only one data source. You need to configure the feature "*automatic data update*" in your subscription to automate the imports of more data sources.

Navigation menu