Difference between revisions of "Automate Update data"

From TaticView
Jump to: navigation, search
(Marked this version for translation)
Line 10: Line 10:
  
 
<!--T:2-->
 
<!--T:2-->
You can automate the data update of your Data Files.
+
With TaticView, you can automate the update of your [[Data_Sources|Data Files]].
  
 
<!--T:3-->
 
<!--T:3-->
Some setup procedures and the use of [[TVCli]] command line program are necessary to automate updates on TavicView.  
+
To do so, it is necessary to adjust the settings and to use the command line program [[TVCli]].
  
 
<!--T:4-->
 
<!--T:4-->
If you are having trouble, open a support ticket on https://support.taticview.com/open.php. We are glad to help you.
+
See below the required steps to automate the data updates.
  
 
=== Installing TVCli === <!--T:5-->
 
=== Installing TVCli === <!--T:5-->
Line 22: Line 22:
  
 
<!--T:6-->
 
<!--T:6-->
First download the installer:
+
Download the installer first
 
* <u>[http://wiki.taticview.com/taticfiles/tvcli-windows-installer.exe Windows]</u>  
 
* <u>[http://wiki.taticview.com/taticfiles/tvcli-windows-installer.exe Windows]</u>  
 +
  
 
<!--T:7-->
 
<!--T:7-->
Then run the installation on the same workstation where the files that are going to be automatically imported are.
+
Run the installation on the machine where the schedules will be created to run the TVCli. TVCli works through command line. After you have created the executable containing the disered command, you can schedule its running process through your disered task scheduler.
  
  
 
<!--T:38-->
 
<!--T:38-->
<span style="color: red;">'''Important:'''</span> TVCli works with java from version <i>7.0_80</i>. However, we recommend using <em>Java 8</em> because <i>Java 7</i> is discontinued by Oracle.
+
<span style="color: red;">'''Important:'''</span>  
 +
* TVCli works with any java version after <i>7.0_80</i>, but we recomend using <em>Java 8</em> as Oracle no longer supports <i>Java 7</i>.
 +
* A notification will be displayed to the user if an error occurred during the data update.
 +
* A log with the execution details will be generated in the user's settings folder (Example: <i>C:\Usuários\<usuário>\AppData\Local\TVCli\Logs</i>).
 +
* TaticView's free subscription only allows you to automate the update of one data file. It will be necessary to set the automatic data update feature in your subscription.
  
  
=== Access TOKEN generation === <!--T:8-->
+
=== Generating the Access TOKEN === <!--T:8-->
  
 
<!--T:9-->
 
<!--T:9-->
You must have an '''[[Tokens|Access TOKEN]]''' registered on TaticView and TVCli before you can run an automation import.  
+
To automate the data updates through TCVli, it is necessary to own an '''[[Tokens|Access TOKEN]]''' created on TaticView and then register it on TVCli.
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.  
+
An Access TOKEN is always linked to a TaticViwe user. The TOKEN works like a TaticView generated password that allows access to TVCli. The TOKEN can be revoked at any moment, allowing you to decide who can access your TaticView account and when. It is important to remember that this access only allows the update of data files that are set to be automatically updated.
It can be revoked by you at any time, allowing you to decide who and when can access your account on TaticView.  
+
 
  
 
<!--T:10-->
 
<!--T:10-->
You can generate the Access TOKEN in two ways:
+
There are two ways to generate an Access TOKEN:
  
  
 
<!--T:11-->
 
<!--T:11-->
 
'''Through TVCli'''
 
'''Through TVCli'''
# Run the command through command line requesting the generation of a new Access TOKEN.
+
# Run the command through a command line requesting the generation of an Access TOKEN.
  
 
   <!--T:12-->
 
   <!--T:12-->
'''Syntax: tvcli -cmd get_token_by_password -user <user name> -password <user password> [-token_name "<token name>"]'''
+
'''Command Syntax: tvcli -cmd get_token_by_password -user <your TaticView user> -password <your TaticView password> [-token_name "<token name>"]'''
  
 
   <!--T:13-->
 
   <!--T:13-->
-cmd                  - get_token_by_password - Requests and stores the ACCESS TOKEN through command line. (TVCli)
+
-cmd                  - get_token_by_password - The command responsible for requesting and storing the Access TOKEN on the TVCli settings.
   -user                  - TaticView user
+
   -user                  - Your TaticView user (access e-mail).
   -password              - TaticView password
+
   -password              - Your TaticView access password.
   -token_name (optional) - The name that you want to give to the access token. Default name "TaticView CLI"         
+
   -token_name (optional) - The name you want to set to your Access TOKEN. The default name '''TaticView CLI''' will be set if you do not specify a name.       
  
 
   <!--T:14-->
 
   <!--T:14-->
'''Example: tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVCli Server 1"'''
+
'''Example: tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVCli Server 1" '''
  
 
    
 
    
 
<!--T:15-->
 
<!--T:15-->
'''Through TacticView interface'''
+
'''Through TaticView's interface'''
# Identify yourself on TaticView and access the '''My account''' button '''Access TOKENS''';
+
# On the TaticiView [[Main Page Overview|home screen]], select [[User profile|My Acount]] and click on the [[Tokens|Access TOKENS]] button;
# On [[File:identificacao-novo-token+en-US.png]] enter a name to identify the Access TOKEN on the list and then click on '''Generate new TOKEN'''.
+
# On [[File:identificacao-novo-token+en-US.png]] inform a name to identify your Access TOKEN on the list and select '''Generate new TOKEN''';
# An Access TOKEN will be generated [[File:generated-token+en-US.png]]
+
# A new Access TOKEN will be generated [[File:generated-token+en-US.png]]
# Run TVcli informing the generated Access TOKEN
+
# Run the TVCli TOKEN storing command (<i>store_token</i>), informing the last generated TOKEN;
  
 
   <!--T:16-->
 
   <!--T:16-->
'''Syntax: tvcli -cmd store_token -user <user name> -token <generated token>'''
+
'''Command Syntax: tvcli -cmd store_token -user <your TaticView user> -token <the token generated on TaticView>'''
  
 
   <!--T:17-->
 
   <!--T:17-->
-cmd  - store_token - stores token generated through the interface
+
-cmd  - store_token - The command responsible for storing the TOKENS generated on TaticView.
   -user  - TaticView user  
+
   -user  - Your TaticView user (access e-mail).
   -token - The token generated through the interface
+
   -token - The token generated on TaticView.
  
 
   <!--T:18-->
 
   <!--T:18-->
Line 81: Line 86:
  
  
=== Updating in an automated way === <!--T:19-->
+
=== Updating your data automatically === <!--T:19-->
  
 
<!--T:20-->
 
<!--T:20-->
You can only automate the update of data sources that have been already created on TaticView, so you are going to need at least one manual import to create the necessary structure.
+
You can only automate the update of files that exist on TaticView. It will be necessary to import your file/spreadsheet manually for the first time to generate the required 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:
+
After that, it will be necessary to enable the automatic update to the desired data file. To do so, access the TaticView [[Main Page Overview|main page]], click on data files, select <i>Settings</i>, and enable the <i>Automatic Update</i> option. After that, it will display the data files code on the screen. See the example below:
  
 
<!--T:21-->
 
<!--T:21-->
Line 95: Line 100:
 
<!--T:22-->
 
<!--T:22-->
 
[[File:automatic-importation+en-US.png]]
 
[[File:automatic-importation+en-US.png]]
 +
  
 
<!--T:23-->
 
<!--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.
+
You can execute the data import automatically using the identifier code through command line if the data file has permission to be updated automatically.
  
 
   <!--T:24-->
 
   <!--T:24-->
'''Syntax: tvcli -cmd import_file -user <user name> -datamart <identifier> -file "<file/spreadsheet>" [-type <type>] [-wait -[notifyshare]] [-nonotifyerror] '''
+
'''Command Syntax: tvcli -cmd import_file -user <your TaticView user> -datamart <data file identification code> -file "<file/spreadsheet address>" [-type "<type>"] [-wait [-notifyshare]] [-nonotifyerror]
 +
'''
  
 
   <!--T:25-->
 
   <!--T:25-->
-cmd                  - import_file  - uploads the data file and places it in the import queue
+
-cmd                  - import_file  - Command that uploads your files and add them to the update queue.
   -user                  - TaticView user  
+
   -user                  - Your TaticView user (access e-mail).
   -datamart              - identifier of the data file obtained in the Data file properties at the interface.
+
   -datamart              - The identification code of the data file obtained through the properties option on the TaticView main page.
   -file                  - Text data file (CSV) or spreadsheet (XLSX,XLS) to be imported.
+
   -file                  - The address of the text (CSV) or spreadsheet (XLSX, XLS, XLSM) data file that will be updated. You can use mapped drives (Ex.: C:\, D:\) or UNC address (Ex.: \\server\folder\file).
   -type (opcional)      - clear_and_add - Deletes all data from TaticView Data File and imports the new data. (default)
+
   -type (opcional)      - clear_and_add - Deletes every data from the TaticView's Data File and imports new data. This is TVCli's default behavior.
                           append        - Adds the new data at the end of the TaticView Data File. It is necessary to be careful not to duplicate any data.
+
                           append        - It adds new data to your TaticView's data files file/spreadsheet while still keeping the previously imported data. It's important to make sure to not duplicate any data.
   -wait (opcional)      - waits for the end of the import. It is needed to test '''Output Status'''
+
   -wait (opcional)      - Command that makes TVCli wait the end of your data updates along with TaticView. It's necessary in case you want to test commands responses (ERROR_LEVEL).
   -nonotifyerror (opcional)    - does not notify the user if an error occurs during the process
+
   -nonotifyerror (opcional)    - Command used to not notify the user in case of an error occurring during the update 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.
+
   -notifyshare (opcional) - Command used to send a notification to the users who own shared dashboards informing that the data update finished successfully. This command only works when used with the <i>-wait</i> command.  
  
 
   <!--T:26-->
 
   <!--T:26-->
 
'''Example:'''
 
'''Example:'''
 +
  '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "\\servidor\taticview\imp\myspreadsheet.xls" '''
 
   '''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\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\file.csv" -wait -notifyshare'''
Line 126: Line 134:
  
 
<!--T:36-->
 
<!--T:36-->
Shows TVCli version on console and register into log file.  
+
You can run the <i>-version</i> command to see which TVCli version is installed on your computer. This command displays the TVCli version on the console and registers it on the TVCli log.
  
 
   <!--T:37-->
 
   <!--T:37-->
'''Syntax: tvcli -version'''
+
'''Command Syntax: tvcli -version'''
  
  
=== Command return test === <!--T:27-->
+
=== Commands response test === <!--T:27-->
  
 
<!--T:28-->
 
<!--T:28-->
The TVCli executable returns different codes to report the success or failure during the execution process.
+
TVCli executable returns specific codes to inform the success or failure of its commands. Currently, the available codes are:
  
 
   <!--T:29-->
 
   <!--T:29-->
Line 142: Line 150:
  
 
<!--T:30-->
 
<!--T:30-->
A notification is sent to the user if an error occurs during the import process.
+
You can perform treatments in your automation script based on these return codes.
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).
+
 
 +
 
 +
=== Questions on how generate the automation commands? ===
 +
 
 +
Open a [https://support.taticview.com/open.php/?&lang=en_US support ticket]. In case you are having problems during the TVCli configuration process. It will be a pleasure to help.
 +
 
 +
Also, on the Data Files properties screen, when clicking the link <i>help to generate automation commands?</i>, it will display the [[TVCli Generate Commands]] screen, where you can obtain preset TVCli commands. All you have to do is inform some required data.
  
  
Line 156: Line 170:
 
  '''echo "Problems updating SALES!"
 
  '''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
+
  '''call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.Sadig\Documents\TaticView\Import Files\rh.xlsx" -datamart 673 -wait
 
  '''if %errorlevel% == 0 (
 
  '''if %errorlevel% == 0 (
   '''echo "HR updated successfully!"
+
   '''echo "RH updated successfully!"
 
  ''') else (
 
  ''') else (
   '''echo "Problems updating HR!"
+
   '''echo "Problems updating RH!"
 
  ''')'''
 
  ''')'''
 
 
<!--T:33-->
 
<span style="color: red;">'''Important'''</span>
 
 
<!--T:34-->
 
TaticView free subscription allows only one data source to have an automated update. You need to configure the feature '''automatic data update''' in your [[Subscriptions|subscription]] to automate the imports of more data sources.
 
  
  
 
</translate>
 
</translate>

Revision as of 14:02, 7 March 2018

Other languages:
English • ‎português do Brasil


With TaticView, you can automate the update of your Data Files.

To do so, it is necessary to adjust the settings and to use the command line program TVCli.

See below the required steps to automate the data updates.

Installing TVCli

Download the installer first


Run the installation on the machine where the schedules will be created to run the TVCli. TVCli works through command line. After you have created the executable containing the disered command, you can schedule its running process through your disered task scheduler.


Important:

  • TVCli works with any java version after 7.0_80, but we recomend using Java 8 as Oracle no longer supports Java 7.
  • A notification will be displayed to the user if an error occurred during the data update.
  • A log with the execution details will be generated in the user's settings folder (Example: C:\Usuários\<usuário>\AppData\Local\TVCli\Logs).
  • TaticView's free subscription only allows you to automate the update of one data file. It will be necessary to set the automatic data update feature in your subscription.


Generating the Access TOKEN

To automate the data updates through TCVli, it is necessary to own an Access TOKEN created on TaticView and then register it on TVCli.

An Access TOKEN is always linked to a TaticViwe user. The TOKEN works like a TaticView generated password that allows access to TVCli. The TOKEN can be revoked at any moment, allowing you to decide who can access your TaticView account and when. It is important to remember that this access only allows the update of data files that are set to be automatically updated.


There are two ways to generate an Access TOKEN:


Through TVCli

  1. Run the command through a command line requesting the generation of an Access TOKEN.
 Command Syntax: tvcli -cmd get_token_by_password -user <your TaticView user> -password <your TaticView password> [-token_name "<token name>"]
 -cmd                   - get_token_by_password - The command responsible for requesting and storing the Access TOKEN on the TVCli settings.
 -user                  - Your TaticView user (access e-mail).
 -password              - Your TaticView access password.
 -token_name (optional) - The name you want to set to your Access TOKEN. The default name TaticView CLI will be set if you do not specify a name.         
 Example: tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVCli Server 1" 


Through TaticView's interface

  1. On the TaticiView home screen, select My Acount and click on the Access TOKENS button;
  2. On Identificacao-novo-token+en-US.png inform a name to identify your Access TOKEN on the list and select Generate new TOKEN;
  3. A new Access TOKEN will be generated Generated-token+en-US.png
  4. Run the TVCli TOKEN storing command (store_token), informing the last generated TOKEN;
 Command Syntax: tvcli -cmd store_token -user <your TaticView user> -token <the token generated on TaticView>
 -cmd   - store_token - The command responsible for storing the TOKENS generated on TaticView.
 -user  - Your TaticView user (access e-mail).
 -token - The token generated on TaticView.
 Example: tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5


Updating your data automatically

You can only automate the update of files that exist on TaticView. It will be necessary to import your file/spreadsheet manually for the first time to generate the required structure.

After that, it will be necessary to enable the automatic update to the desired data file. To do so, access the TaticView main page, click on data files, select Settings, and enable the Automatic Update option. After that, it will display the data files code on the screen. See the example below:

Datamart-dropdown+en-US.png


File:Automatic-importation+en-US.png


You can execute the data import automatically using the identifier code through command line if the data file has permission to be updated automatically.

 Command Syntax: tvcli -cmd import_file -user <your TaticView user> -datamart  -file "<file/spreadsheet address>" [-type "<type>"] [-wait [-notifyshare]] [-nonotifyerror]  

 -cmd                   - import_file   - Command that uploads your files and add them to the update queue.
 -user                  - Your TaticView user (access e-mail).
 -datamart              - The identification code of the data file obtained through the properties option on the TaticView main page.
 -file                  - The address of the text (CSV) or spreadsheet (XLSX, XLS, XLSM) data file that will be updated. You can use mapped drives (Ex.: C:\, D:\) or UNC address (Ex.: \\server\folder\file).
 -type (opcional)       - clear_and_add - Deletes every data from the TaticView's Data File and imports new data. This is TVCli's default behavior.
                          append        - It adds new data to your TaticView's data files file/spreadsheet while still keeping the previously imported data. It's important to make sure to not duplicate any data.
 -wait (opcional)       - Command that makes TVCli wait the end of your data updates along with TaticView. It's necessary in case you want to test commands responses (ERROR_LEVEL).
 -nonotifyerror (opcional)    - Command used to not notify the user in case of an error occurring during the update process. 
 -notifyshare (opcional) - Command used to send a notification to the users who own shared dashboards informing that the data update finished successfully. This command only works when used with the -wait command. 
 Example:
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "\\servidor\taticview\imp\myspreadsheet.xls" 
 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

You can run the -version command to see which TVCli version is installed on your computer. This command displays the TVCli version on the console and registers it on the TVCli log.

 Command Syntax: tvcli -version


Commands response test

TVCli executable returns specific codes to inform the success or failure of its commands. Currently, the available codes are:

 0 - Success
 8 - Error

You can perform treatments in your automation script based on these return codes.


Questions on how generate the automation commands?

Open a support ticket. In case you are having problems during the TVCli configuration process. It will be a pleasure to help.

Also, on the Data Files properties screen, when clicking the link help to generate automation commands?, it will display the TVCli Generate Commands screen, where you can obtain preset TVCli commands. All you have to do is inform some required data.


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\rh.xlsx" -datamart 673 -wait
if %errorlevel% == 0 (
  	echo "RH updated successfully!"
) else (
  	echo "Problems updating RH!"
)