Difference between revisions of "Automate Update data/en"

From TaticView
Jump to: navigation, search
(Importing a new version from external source)
(Importing a new version from external source)
Line 24: Line 24:
 
=== ACCESS TOKEN generation ===
 
=== ACCESS TOKEN generation ===
  
You must have an '''ACCESS TOKEN''' registered on TaticView and TVcli before you can run an automation import.  
+
You must have an '''[[Tokens|ACCESS TOKEN]]''' registered on TaticView and TVCli before you can run an automation import.  
 
An ACCESS TOKEN is always related with a TaticView user.  
 
An ACCESS TOKEN is always related with a TaticView user.  
 
The ACCESS TOKEN is like a password generated by TaticView which allows access to your account through TVCli.  
 
The ACCESS TOKEN is like a password generated by TaticView which allows access to your account through TVCli.  

Revision as of 11:50, 26 September 2017

Other languages:


Data update automation on TaticView

You can automate the data update of your Data Files.

Some setup procedures and the use of TVCli command line program are necessary to automate updates on TavicView.

If you are having trouble, open a support ticket on https://support.taticview.com/open.php. We are glad to help you.

Installing TVCli

First download the installer:

Then run the installation on the same workstation where the files that are going to be automatically imported are.


Important: TVCli works with java from version 7.0_80. However, we recommend using Java 8 because Java 7 is discontinued by Oracle.


ACCESS TOKEN generation

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. The ACCESS TOKEN is like a password generated by TaticView which allows access to your account through TVCli. It can be revoked by you at any time, allowing you to decide who and when can access your account on TaticView.

You can generate the ACCESS TOKEN in two ways:


Through TVCli

  1. Run the command through command line requesting the generation of a new ACCESS TOKEN.
 Syntax: tvcli -cmd get_token_by_password -user <user name> -password <user password> [-token_name "<token name>"]
 -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"          
 Example: tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVcli Server 1"


Through TacticView interface

  1. Identify yourself on TaticView and access the My account button ACCESS TOKENS;
  2. On !identificacao-novo-token.png! enter a name to identify the ACCESS TOKEN on the list and then click on Generate new TOKEN.
  3. An ACCESS TOKEN will be generated !generated-token.png!
  4. Run TVcli informing the generated ACCESS TOKEN
 Syntax: tvcli -cmd store_token -user <user name> -token <generated token>
 -cmd   - store_token - stores token generated through the interface
 -user  - TaticView user 
 -token - The token generated through the interface
 Example: tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5


Updating in an automated way

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:

Datamart-dropdown+en-US.png


File:Automatic-importation+en-US.png

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.

 Syntax: tvcli -cmd import_file -user <user name> -datamart <identifier> -file "<file/spreadsheet>" [-type <type>] [-wait -[notifyshare]] [-nonotifyerror] 
 -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.
 -file                  - Text data file (CSV) or spreadsheet (XLSX,XLS) to be imported.
 -type (opcional)       - clear_and_add - Deletes all data from TaticView Data File and imports the new data. (default)
                          append        - Adds the new data at the end of the TaticView Data File. It is necessary to be careful not to duplicate any data.
 -wait (opcional)       - waits for the end of the import.  It is needed to test Output Status
 -nonotifyerror (opcional)    - does not notify the user if an error occurs during the process
 -notifyshare (opcional) - sends data update notification to users who have these data file dashboards shared when the importing process ends without errors. Only works with -wait.
 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" -wait -notifyshare
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -wait
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type clear_and_add
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append -nonotifyerror


TVCli version

Shows TVCli version on console and register into log file.

 Syntax: tvcli -version


Command return test

The TVCli executable returns different codes to report the success or failure during the execution process.

 0 - Success
 8 - Error

A notification is sent to the user if an error occurs during the import process. A log with the details of the executions will be generated in the configuration directory of the user (example: C: \ Users \ <user> \ AppData \ Local \ TVcli \ Logs).


Script example

@ECHO OFF
call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.SADIG\Documents\TaticView\Import Files\sales.xlsx" -datamart 674 -wait
if %errorlevel% == 0 (
	echo "SALES updated successfully!"
) else (
	echo "Problems updating SALES!"
)
call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.Sadig\Documents\TaticView\Import Files\hr.xlsx" -datamart 673 -wait
if %errorlevel% == 0 (
  	echo "HR updated successfully!"
) else (
  	echo "Problems updating HR!"
)


Important

TaticView free subscription allows only one data source to have an automated update. You need to configure the feature automatic data update in your subscription to automate the imports of more data sources.