Open main menu

TaticView β

Changes

Automate Update data/en

1,284 bytes added, 19:12, 16 July 2021
Updating to match new version of source page
=== Generating the Access TOKEN ===
To automate the data updates through TCVli, it is necessary to own an '''[[TokensManage_Access|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.
===Through =Using TVCli (command line)====# Run the command through a command line requesting the generation of an Access TOKEN.
'''tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVCli Server 1" '''
===Through =Using TaticView's graphical interface====
# 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]] inform a name to identify your Access TOKEN on the list and select '''Generate new TOKEN''';
Example:
'''tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5'''
 
=== Updating your data automatically ===
'''Call "C:\Program Files\TvCli\tvcli" -cmd import_file -user myemail@email.com -datamart 246 -file "D:\taticview\imp\spreadsheet.xlsx" -wait'''
=== Running TVCli version from BAT (Script) 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. 
Command Syntax: '''tvcli -version'''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.
=== TVCli log (since version 1.1) ===
You can run the '''''Attention'''''<ibr>show_logs<To execute TVCli from a BAT file, you have to use the Windows [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/i> call CALL] command to show the log . Ie.: '''CALL''' C:\TaticView\tvcli -cmd import_file -user jonathan@sadig.com -file"C:\Users\jonathan\Documents\TaticView\Import Files\rh.xlsx" -datamart 673 -wait
Command Syntax:
'''tvcli -cmd show_logs''' - Show the current day logs'''
'''tvcli -cmd show_logs -all''' - Show all logs in the logs directory'''
==== Evaluating if command execution was successful ====
=== Commands response test ===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.
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.
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% === Questions on how generate the automation commands? ===0 ( echo SALES updated successfully!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. ) else ( echo Problems updating SALES!Also, on the Data Files properties screen, when clicking the link <i>help to generate automation commands?</i>, it will display the [[TVCli Commands]] screen, where you can obtain preset TVCli commands. All you have to do is inform some required data. )
=== = 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:\TaticView\tvcli -cmd import_file -user jonathanmy@sadigemail.com -file "C:\Users\jonathan\Documents\TaticView\Import Files\sales.xlsx" -datamart 674 -wait
'''if %errorlevel% == 0 (
'''echo SALES updated successfully!
'''echo Problems updating SALES!
''')
'''call C:\TaticView\tvcli -cmd import_file -user jonathanmy@sadigemail.com -file "C:\Users\jonathan\Documents\TaticView\Import Files\rhhr.xlsx" -datamart 673 -wait
'''if %errorlevel% == 0 (
'''echo RH HR updated successfully!
''') else (
'''echo Problems updating RHHR!
''')'''
 
=== 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 <i>help to generate automation commands?</i>, it will display the [[TVCli Commands]] screen, where you can obtain preset TVCli commands. All you have to do is inform some required data.
 
You can also 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 you.
 
 
=== Other TVCli commands ===
 
==== TVCli show version ====
 
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.
 
 
Command Syntax:
'''tvcli -version'''
 
==== TVCli show log ====
 
''since TVCli version 1.1''
 
You can run the <i>show_logs</i> command to show the log file.
 
Command Syntax:
'''tvcli -cmd show_logs''' - Show the current day logs'''
'''tvcli -cmd show_logs -all''' - Show all logs in the logs directory'''
11,677
edits