Open main menu

TaticView β

Changes

Automate Update data/en

3,376 bytes added, 13:26, 15 April 2023
Updating to match new version of source page
-->
You With TaticView, you can automate the data update of your [[Data_Sources|Data Files]].
Some setup procedures To do so, it is necessary to adjust the settings and to use the use of command line program [[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 See below the required steps to help youautomate the data updates.
<span style="color: red;">'''Important:'''</span> * To use TVCli works with , the computer where it will be configured must have java from version <i>7.0_808</i>installed. If you use a Java minor version the message "Unsupported major. Howeverminor version 52.0" will be showed, we recommend using <em>see [[Java 8JRE 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: </emi> because C:\Users\<iuser>Java 7\AppData\Local\TVCli\Logs</i> is discontinued by Oracle).
=== Installing TVCli ===
For now, we have only a user friendly installer for Windows. If you need install TVCli in other platforms, please contact us at <u>[https://support.taticview.com Support]</u>. We are glad to to help you to install it in you environment.
First download * '''Download the installer:* <u>[http://wiki.taticview.com/taticfiles/tvcli-windows-installer.exe Windows[TVCli Download|latest version]]</u>
The browser can try to block the installer download. If you can't download please enter in contact with our support.
Windows can too block the installer execution to protect the computer. In this case continue the installation choosing the advanced options.
In both situations if you need contact us to help you.
Then run the installation on the same workstation where the files that are going to be automatically imported are.
* '''Run the installation''' on the computer where the schedules will be created to run the TVCli.
=== Access TOKEN generation ===
You must have an '''[[Tokens|Access TOKEN]]''' registered on TaticView and TVCli before works through command line. The best way to automate the execution is creating a script, after that, you can schedule it to run an automation importon the system task scheduler. <br/>An Access TOKEN is always related with a TaticView userTo install and execute TVCli on you computer we need Java JRE version 1.8. The Access TOKEN is like a password generated by TaticView which allows access to your account through TVCli0_200 or newer installed. <br/>It On [[Java JRE install and troubleshooting]] we can be revoked by you at any time, allowing help you to decide who and when can access your account on TaticViewin case of doubts.
An === Generating the 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.===
To automate the data updates through TCVli, it is necessary to own an '''[[Manage_Access#Tokens|Access TOKEN]]''' created on TaticView and then register it on TVCli.
You An Access TOKEN is always linked to a TaticView user. The TOKEN works like a TaticView generated password that allows access to TVCli. The TOKEN '''[[Manage_Access#Tokens|can generate 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 Access TOKEN in two ways:update of data files that are set to be automatically updated.
'''Through TVCli'''# Run the command through command line requesting the generation of Here we will show you how to generate a new Access TOKENtoken whit TaticView interface.
There are two ways to generate an Access TOKEN:
'''Syntax: tvcli -cmd get_token_by_password -user <user name> -password <user password> The main difference between them, besides the way they are generated, is that [[-token_name "<token name>"#Using_TVCli_command_line|command line]] selves, while the created by [[#Using_TaticView's_graphical_interface|TaticView interface]] don''t refresh them selves (expire), and need to be recreated.
  ====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]]   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 - Requests The command responsible for requesting and stores storing the ACCESS Access TOKEN through command lineon the TVCli settings. (TVCli) -user - Your TaticView user(access email). -password - Your TaticView access password. -token_name (optional) - The name that you want to give set to the access tokenyour Access TOKEN. Default 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" '''
''====Using TaticView'Through TacticView s graphical interface'''# Identify yourself on TaticView and access the '''My account''' button '''Access TOKENS''';# 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'''.# An Access TOKEN will be generated [[File:generated-token+en-US.png]]# Run TVcli informing the generated Access TOKEN====
Here we will show you how to generate a token whit TaticView 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'''Syntax;# A new Access TOKEN will be generated [[File: tvcli generated-cmd store_token token+en-user US.png]]# Run the TVCli TOKEN storing command (<user namei> -token store_token</i>), informing the last generated token>'''TOKEN;
-cmd - store_token - stores token generated through the interface
-user - TaticView user
-token - The token generated through the interface
Command Syntax: '''Example: tvcli -cmd store_token -user meuemail@email.com <your TaticView user> -token 9bdr845gh5r4r1vd5d5<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.
=== Updating in an automated way ===Example: '''tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5'''
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.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 === Updating your data file, as you can see in the example below:automatically ===
After You can only automate the update of files that, it exist on TaticView. It will be necessary to enable the automatic update to the desired data import your file. To do so, access the TaticView [[Main Page Overview|main page]], click on data files, select <i>Settings</i>, and enable spreadsheet manually for the <i>Automatic Update</i> option. After that, it will display the data files code on first time to generate the screenrequired structure. See the example below:
After that, it will be necessary to enable the automatic update to the desired data file. For this you must access the properties of the desired ''Datasource''. Access is available in the context menu of the Datasource card in the [[File:datamart-dropdown+en-US.pngMain Page Overview|TaticView main page]]:
{| 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=]]
|}
[[File:automatic-Then, the ''Automatic importation+en-US'' option should be enabled.png]]When you do this, you will see the data file code, as in the example below:
Once the data file is imported, granted for [[File:automatic import and you have your identification code, you can run the import through the command line-importation+en-US.PNG]]
'''Command Syntax: tvcli -cmd import_file -user <your TaticView user> -datamart <You can execute the data file identification import automatically using the identifier code> -file "<through command line if the data file/spreadsheet address>" [-type "<type>"] [-wait [-notifyshare]] [-nonotifyerror] '''has permission to be updated automatically.
-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.
'''ExampleCommand Syntax:''' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx"''' '''tvcli -cmd import_file -<your TaticView user myemail@email.com > -datamart 246 -file "c:\taticview\imp\< data file.csv" -wait -notifyshare''' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 identification code> -file "c:\taticview\imp\spreadsheet.xlsx" -wait''' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -<file "c:\taticview\imp\/spreadsheet.xlsxaddress>" [-type clear_and_add''' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx<type>" ] [-type append''' '''tvcli wait [-cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append 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.
=== TVCli version === 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"'''Shows TVCli version on console and register into log '''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''' '''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 ===
'''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.
=== Command return test ==='''''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''' C:\TaticView\tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan\Documents\TaticView\Import Files\rh.xlsx" -datamart 673 -wait
The TVCli executable returns different codes to report the success or failure during the execution process.
'''0 - Success''' '''8 - Error'''==== Evaluating if command execution was successful ====
A notification is sent At end of a command execution, TVCli returns specific codes to inform the user if an error occurs during success or failure of the import processcommand.A log with This allows the details of the executions will be generated in the configuration directory of BAT file to verify if the user (example: C:\Users\<user>\AppData\Local\TVcli\Logs)previous TVCli command was completed successfully.
Currently, the available codes are:
=== Questions on how generate the automation commands? === '''0 - Success''' '''8 - Error'''
Open a You can perform treatments in your automation script based on these return codes.For this you can [https://supportdocs.taticviewmicrosoft.com/open.phpen-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/?&langcc754335(v=en_US support ticketws.11) use ERROLEVEL]Windows environment variable. In case you are having problems during the TVCli configuration process. It will be a pleasure to helpIe.:
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. 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.
=== Script example ===  '''@ECHO OFF''' '''call C:\TaticView\tvcli -cmd import_file -user jonathanmy@sadigemail.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 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 <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.
11,677
edits