Open main menu

TaticView β

Changes

Automate Update data

5,180 bytes added, 13:26, 15 April 2023
no edit summary
<languages/>
 
<translate>
<!--T:39-->
<div style="float: right;">__TOC__</div>
 
<!--
== '''Data update automation on TaticView''' == <!--T:1-->
-->
<!--T:2-->
You With TaticView, you can automate the data update of your [[Data_Sources|Data Files]].
<!--T:3-->
Some setup procedures To do so, it is necessary to adjust the settings and to use the use of TVCli command line program are necessary to automate updates on TavicView[[TVCli]].
<!--T:4-->
If you are having trouble, open a support ticket on httpsSee below the required steps to automate the data updates.  <!--T:38--><span style="color: red;">'''Important:'''</span> * To use TVCli, the computer where it will be configured must have java from version <i>8</supporti> installed.taticviewIf you use a Java minor version the message "Unsupported major.com/openminor version 52.php0" will be showed, see [[Java JRE install and troubleshooting]] for help. We are glad * A notification will be displayed to help youthe 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>)
=== Installing TVCli === <!--T:5-->
<!--T:65-->
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.
<!--T:6-->
First download * '''Download the installer:[[TVCli Download|latest version]]  * <u>[http!--T://wiki.taticview.com/taticfiles/tvcli51-windows->The browser can try to block the installerdownload.exe If you can't download please enter in contact with our support.Windows]</u> 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. 
<!--T:7-->
Then run * '''Run the installation ''' on the same workstation computer where the files schedules will be created to run the TVCli.  <!--T:59-->TVCli works through command line. The best way to automate the execution is creating a script, after that are going , you can schedule it to be automatically imported arerun on the system task scheduler.<br/>To install and execute TVCli on you computer we need Java JRE version 1.8.0_200 or newer installed.<br/>On [[Java JRE install and troubleshooting]] we can help you in case of doubts.
=== ACCESS Generating the Access TOKEN generation === <!--T:8-->
<!--T:9-->
You must have To automate the data updates through TCVli, it is necessary to own an '''ACCESS [[Manage_Access#Tokens|Access TOKEN]]''' registered created on TaticView and TVcli before you can run an automation importthen register it on TVCli.  <!--T:40-->An ACCESS Access TOKEN is always related with linked to a TaticView user. The ACCESS TOKEN is works like a TaticView generated password generated by TaticView which that allows access to your account through TVCli. It The TOKEN '''[[Manage_Access#Tokens|can be revoked by you ]]''' at any timemoment, allowing you to decide who and when can access your TaticView account on and when. It is important to remember that this access only allows the update of data files that are set to be automatically updated.  <!--T:60-->Here we will show you how to generate a token whit TaticViewinterface.
<!--T:10-->
You can There are two ways to generate an Access TOKEN: <!--T:61-->The main difference between them, besides the way they are generated, is that [[#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==== <!--T:11-->Run the command through a command line requesting the ACCESS generation of an [[Manage_Access#Tokens|Access TOKEN in two ways:]].
<!--T:62-->
To help you on this, we wave a [[TVCli Commands|Wizard]]
<!--T:11-->
'''Through TVcli'''
# Run the command through command line requesting the generation of a new ACCESS TOKEN.
<!--T:12-->Command Syntax: '''Syntax: tvcli -cmd get_token_by_password -user <your TaticView user name> -password <user your TaticView password> [-token_name "<token name>"]'''
<!--T:13-->
-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.  <!--T:14-->Example: '''tvcli -cmd get_token_by_password -user myemail@email.com -password 123466 -token_name "TVCli Server 1" ''' ====Using TaticView's graphical interface==== <!--T:15--> <!--T:63-->Here we will show you how to generate a token whit TaticView interface.
<!--T:1464--># 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 '''ExampleGenerate new TOKEN''';# A new Access TOKEN will be generated [[File: tvcli generated-cmd get_token_by_password token+en-user myemail@emailUS.com -password 123466 -token_name "png]]# Run the TVCli Server 1"'''TOKEN storing command (<i>store_token</i>), informing the last generated TOKEN;
<!--T:15-->
'''Through TacticView 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
<!--T:16-->Command Syntax: '''Syntax: tvcli -cmd store_token -user <your TaticView user name> -token <the token generated tokenon TaticView>'''
<!--T:17-->
-cmd - store_token - stores token The command responsible for storing the TOKENS generated through the interfaceon TaticView. -user - Your TaticView user (access email). -token - The token generated through the interfaceon TaticView. <!--T:18-->Example: '''tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5'''
=== Updating your data automatically === <!--T:1819-->'''Example: tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5'''
<!--T:20-->
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.
=== Updating in an automated way === <!--T:1941-->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 [[Main Page Overview|TaticView main page]]:
<!--T:2045-->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{| class="images-table"| On desktop|-|[[File:Datasources properties en-US.png|link=]]|-| In mobile devicesThen you must grant the automatic import to the desired data file|-|[[File:Datasources options mobile en-US.png|link=]] [[File:Datasources properties mobile en-US.png|link=]]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:|}
<!--T:21-->
[[File:datamart-dropdown+en-US.png]]
<!--T:46-->
Then, the ''Automatic importation'' option should be enabled. When you do this, you will see the data file code, as in the example below:
<!--T:22-->
[[File:automatic-importation+en-US.pngPNG]] 
<!--T:23-->
Once You can execute the data file is imported, granted for automatic import and you have your identification automatically using the identifier code, you can run the import through the command lineif the data file has permission to be updated automatically
<!--T:24-->Command Syntax: '''Syntax: tvcli -cmd import_file -user <your TaticView user name> -datamart <identifierdata file identification code> -file "<file/spreadsheetaddress>" [-type "<type>"] [-wait [-[notifyshare]] [-nonotifyerror] '''
<!--T:25-->
-cmd - import_file - Command that uploads the data file your files and places it in add them to the import update queue. -user - Your TaticView user (access email). -datamart - identifier The identification code of the data file obtained in through the Data file properties at option on the interfaceTaticView main page. -file - Text data file The address of the text (CSV) or spreadsheet (XLSX,XLS, XLSM) to data file that will be importedupdated. You can use mapped drives (Ex.: C:\, D:\) or UNC address (Ex.: \\server\folder\file). -type (opcional) - clear_and_add - Deletes all every data from the TaticView 's Data File and imports the new data. (This is TVCli's default)behavior. append - Adds the It adds new data at to your TaticView's data files file/spreadsheet while still keeping the end of the TaticView Data Filepreviously imported data. It is necessary 's important to make sure to be careful not to duplicate any data. -wait (opcional) - waits for Command that makes TVCli wait the end of the importyour data updates along with TaticView. It is needed 's necessary in case you want to test '''Output Status'''commands responses (ERROR_LEVEL). -nonotifyerror (opcional) - does Command used to not notify the user if in case of an error occurs occurring during the update process. -notifyshare (opcional) - sends data update Command used to send a notification to the users who have these data file own shared dashboards shared when informing that the importing process ends without errorsdata update finished successfully. Only This command only works when used with the <i>-wait</i> command.  <!--T:26-->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''' '''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 === <!--T:52--> <!--T:53-->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. 
<!--T:2654-->'''Example:''Attention'' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -<br>To execute TVCli from a BAT file "c, you have to use the Windows [https:\taticview\imp\spreadsheet//docs.xlsx"''' '''tvcli -cmd import_file -user myemail@emailmicrosoft.com /en-datamart 246 us/windows-server/administration/windows-file "c:\taticview\imp\filecommands/call CALL] command.csv" -wait -notifyshare''' '''tvcli -cmd import_file -user myemail@emailIe.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -wait ''' CALL'''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "cC:\taticview\impTaticView\spreadsheet.xlsx" -type clear_and_add''' '''tvcli -cmd import_file -user myemailjonathan@emailsadig.com -datamart 246 -file "cC:\taticviewUsers\impjonathan\spreadsheet.xlsx" -type append''' '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:Documents\taticviewTaticView\impImport Files\spreadsheetrh.xlsx" -type append datamart 673 -nonotifyerror'''wait
=== Command return test = Evaluating if command execution was successful ==== <!--T:27-->
<!--T:28-->
The At end of a command execution, TVCli executable returns different specific codes to report inform the success or failure during of the execution processcommand. This allows the BAT file to verify if the previous TVCli command was completed successfully<!--T:55-->Currently, the available codes are:
<!--T:29-->
'''0 - Success''' '''8 - Error'''
<!--T:30-->
A notification is sent to the user if an error occurs during the import processYou 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 (exampleFor this you can [https: C: \ Users \ <user> \ AppData \ Local \ TVcli \ Logs)//docs.microsoft<!com/en-us/previous-T:31versions/windows/it-pro/windows->An example of Windows running script:  <!server-2012-T:32r2-and->'''tvcli -cmd import_file -user meuemail@email2012/cc754335(v=ws.11) use ERROLEVEL] Windows environment variable.com -datamart 246 -file "c:\taticview\imp\planilhaIe.xlsx" -wait -notifyshare''' '''if errorlevel <> 0''' '''Error notification by email''' '''fi''' === TVCli version === <!--T:35-->
<!--T:3656-->Shows TVCli version on console and register into log file. if %errorlevel% == 0 ( echo SALES updated successfully! ) else ( echo Problems updating SALES! )
==== BAT (Script) example ==== <!--T:3731-->'''Syntax: tvcli -version'''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.
<!--T:32-->
'''@ECHO OFF'''
'''call C:\TaticView\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 my@email.com -file "C:\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? === <!--T:3342--><span style="color: red;">'''Important'''</span>
<!--T:3444-->The free version grants TaticView has a wizard the help you on this, on the Data Files properties screen, when clicking the link <i>help to generate automation import from only one data sourcecommands?</i>, it will display the [[TVCli Commands]] screen, where you can obtain preset TVCli commands. You need All you have to configure the feature '''automatic data update''' in your subscription to automate the imports of more do is inform some required data sources.
<!--T:43-->
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.
</translate>