11,677
edits
Changes
Updating to match new version of source page
<languages/>
<div style="float: right;">__TOC__</div>
<span style="color: red;">'''Important:'''</span>
* To use TVCli, the computer where it will be configured must have java from version <i>8</i> installed. If you use a Java minor version the message "Unsupported major.minor version 52.0" will be showed, see [[Java JRE install and troubleshooting]] for help.
* 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:\Users\<user>\AppData\Local\TVCli\Logs</i>).
* '''Through TVcliRun the installation'''# Run on the computer where the command through command line requesting schedules will be created to run the generation of a new ACCESS TOKENTVCli.
There are two ways to generate an Access TOKEN:
====Using TVCli command line====
Run the command through a command line requesting the generation of an [[Manage_Access#Tokens|Access TOKEN]].
To help you on this, we wave a [[TVCli Commands|Wizard]]
Example: '''tvcli -cmd - import_file - uploads the data file and places it in the import queue -user get_token_by_password - 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 datamyemail@email. com -wait (opcional) password 123466 - waits for the end of the import. It is needed to test '''Output Statustoken_name "TVCli Server 1" ''' -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.
Here we will show you how to generate a token whit TaticView interface.
Command Syntax: '''Syntax: tvcli -versioncmd 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 email).
-token - The token generated on TaticView.
{| class="images-table"
| On desktop
|-
|[[File:Datasources properties en-US.png|link=]]
|-
| In mobile devices
|-
|[[File:Datasources options mobile en-US.png|link=]] [[File:Datasources properties mobile en-US.png|link=]]
|}
Then, the ''Automatic importation'' option should be enabled. When you do this, you will see the data file code, as in the example below: [[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 < data file identification code> -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 email). -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 <i>-wait</i> 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@ECHO OFFemail.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''' '''Call "C:\Program Files\TvCli\tvcli" -cmd import_file -user myemail@email.com -datamart 246 -file "D:\taticview\imp\spreadsheet.xlsx" -wait''' === Running TVCli from BAT (Script) file === You can create BAT files to schedule a bunch of TVCli commands. Doing so the entire process can be automated. As you can schedule using Windows scheduler or other similar tool. '''''Attention'''''<br>To execute TVCli from a BAT file, you have to use the Windows [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/call CALL] command. Ie.: '''call CALL''' C:\TaticView\tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan\Documents\TaticView\Import Files\rh.SADIGxlsx" -datamart 673 -wait ==== Evaluating if command execution was successful ==== At end of a command execution, TVCli returns specific codes to inform the success or failure of the command. This allows the BAT file to verify if the previous TVCli command was completed successfully. Currently, the available codes are: '''0 - Success''' '''8 - Error''' You can perform treatments in your automation script based on these return codes.For this you can [https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc754335(v=ws.11) use ERROLEVEL] Windows environment variable. Ie.: if %errorlevel% == 0 ( echo SALES updated successfully! ) else ( echo Problems updating SALES! ) ==== BAT (Script) example ====Bellow we show you a script sample that imports two files to different DataMarts (ids 674 and 673) and test the ERRORLEVEL environment variable to evaluate if the data update was done successfully. '''@ECHO OFF''' '''call C:\DocumentsTaticView\tvcli -cmd import_file -user my@email.com -file "C:\TaticView\Import Files\sales.xlsx" -datamart 674 -wait
'''if %errorlevel% == 0 (
'''echo "SALES updated successfully!"
''') else (
'''echo "Problems updating SALES!"
''')
'''call C:\TaticView\tvcli -cmd import_file -user jonathanmy@sadigemail.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!"
''')'''
=== More questions on how generate the automation commands? ===
TaticView has a wizard the help you on this, on the Data Files properties screen, when clicking the link <span style="color: red;"i>'''Important'''help to generate automation commands?</spani>, it will display the [[TVCli Commands]] screen, where you can obtain preset TVCli commands. All you have to do is inform some required data.