This section describes how to use the data load editor to create or edit a data load script that can be used to load your data model into the app.
The data load script connects an app to a data source and loads data from the data source into the app. When you have loaded the data it is available to the app for analysis. When you want to create, edit and run a data load script you use the data load editor.
You can edit a script manually, or it can be generated by the data manager. If you need to use complex script statements, you need to edit them manually.
Toolbar with the most frequently used commands for the data load editor: global menu, u (debug) and Load data °. The toolbar also displays the save and data load status of the app.
B: Data connections
Under Data connections you can save shortcuts to the data sources (databases or remote files) you commonly use. This is also where you initiate selection of which data to load.
C: Text editor
You can write and edit the script code in the text editor. Each script line is numbered and the script is color coded by syntax components. The text editor toolbar contains commands for Search and replace, Help mode, Undo, and Redo. The initial script already contains some pre-defined regional variable settings, for example SET ThousandSep=, that you generally do not need to edit.
Divide your script into sections to make it easier to read and maintain. The sections are executed from top to bottom.
If you have added data using Add data, you will have a data load script section named Auto-generated section that contains the script code required to load the data.
For more information, see Organizing the script code.
Output displays the autosave status and all messages that are generated during script execution.
If you want to load a file or tables from a database, you need to complete the following steps in Data connections:
- Create new connection linking to the data source ( if the data connection does not already exist).
± Select data from the connection.
When you have completed the select dialog with Insert script, you can select Load data to load the data model into your app.
To learn more about connecting data sources, see: Connecting to data sources
The toolbars allow you to perform global actions on your data load script, such as undo/redo, debug, and search/replace. You can also click Load data ° to reload the data in your app.
Global menu with navigation options, and actions that you can perform in your app.
For more information about tabbed browsing and the global menu, see Navigating using tabs.
Click the tab to perform data tasks. For example you can load data in the Data manager or the Data load editor, or view the data model in the Data model viewer.
The Data tab is not available in a published app, unless you are the owner of the app. In that case, you can only open the Data model viewer.
Click the tab to perform analysis tasks. For example, you can create or interact with tables and charts.
Click the tab to build stories in your app.
|Show or hide app information, where you can choose to edit app information or open app options and style your app.
Note: Once the app has been published, you cannot edit app information nor open app options.
Debug the script.
For more information, see: Debug the data load script
|° Load data||
Run the script to load data. The app is automatically saved before reloading.
For more information, see: Run the script to load data
|h||Toggle Data connections view.|
Script editor toolbar
Search and replace text in the script.
Activate syntax help mode. In help mode you can click on a syntax keyword (marked in blue) in the editor to access detailed syntax help.
Note: It is not possible to edit the script in help mode.
Undo the latest change in the current section (multiple step undo is possible). This is equivalent to pressing Ctrl+Z.
|C||Redo the latest Undo in the current section. This is equivalent to pressing Ctrl+Y.|
For more information, see: Edit the data load script