In Harmoni, you can use data from various file types as the source for new projects, visualizations, and dashboards. Harmoni automatically maps source variables into Harmoni types.
A data source is the starting point for all you do in Harmoni. A source is a collection of data either in an imported file or a connected data store.
Direct connections allow updated data to flow into Harmoni in real time.
- Achieved using APIs (Application Programming Interface).
- If an API is available in a data collection system, we can potentially develop a direct connection to Harmoni.
Harmoni supports different direct connections, including SQL.
In this article
- Summary
- Connect to SQL Server
-
Select SQL tables/views
a. Column-based data
b. Row-based data - Harmoni project
- Refresh SQL sources
1. Summary
- All relevant data exists in a single view or table.
- All data associated with a unique record is reported in a single table or view.
- Key identifiers can be added to field names to advise Harmoni on the default type to import.
- Fields contain labels, not codes. If codes are used, they will need to be renamed to labels after importing.
- Keep in mind that field names in SQL are limited to 128 characters and cannot contain |.
2. Connect to SQL Server
In Harmoni, you can choose to create a new project that connects to an SQL data source, or you can connect from an existing project.
- To create a new project, type in your project name and click on Create New.
- Choose to CONNECT.
- Enter your credentials to connect to the database server.
SQL Credentials
To connect to SQL Server, you need to enter your server name, user name, and password.
3. Select SQL tables/views
After clicking CONNECT, you are presented with the databases available in your connection. There are two options available.
- Column-based data (default setting)
- Row-based data
a. Column-based data
The default setting is Column-based.
- Click on a database, and you are presented with all the tables and views available in that database.
- Click ADD to add the required table(s) to your project.
- Once added, the table will show in the source area.
- Click on the source tile to define the new source, as is required with delimited sources.
- Map the data type of each column.
- Confirm and add the data source to the project.
- Click OK to create the project.
b. Row-based data
Harmoni also has the option for row-based data. Use the switch to change from column-based to row-based.
To make the source selections for row-based data, Harmoni has a three-step process to follow:
1. Select the table/view containing the IDs.
2. Select the table/view with the dictionary.
3. Lastly, select the data.
Once the three-step process is complete, select ADD to add the files to the project.
- The source tile for the row-based source is slightly different from a column-based source and lists the three source files (hover to view the full labels).
- Click OK to create the project.
4. Harmoni project
After connecting to your sources, you can load your Harmoni project. Direct connections allow for a real-time flow of survey data.
5. Refresh SQL sources
To refresh the data through your SQL connection, in the sources area, click the Refresh option from the three-dot menu on the source tile.