Importing constants from Excel into Niagara means reading values from a spreadsheet file and loading them into your Niagara system so they can be used in logic, calculations, and device configuration. The most direct route is to use Niagara's built-in CSV import feature, which accepts Excel files saved in comma-separated format, then map those values to your constant definitions in the Niagara Framework.
Key Takeaways
- Export your Excel file as a CSV (comma-separated values) file before importing, because Niagara's import tool reads CSV format, not native Excel files.
- Your CSV must have a header row naming each column, and the columns must match the fields Niagara expects: constant name, data type, and value.
- Import happens in the Niagara Station tool under the Workbench, using the Import Wizard to map your CSV columns to constant properties.
- Test your import on a small batch of constants first, because mapping errors can create unusable definitions that require manual deletion.
Prepare your Excel file for export
Open your Excel spreadsheet and organize it so each row represents one constant. You need at minimum three columns: one for the constant name, one for the data type (such as int, float, string, or bool), and one for the value itself. Add a header row at the top naming each column clearly — for example, "ConstantName", "DataType", and "ConstantValue".
Remove any formatting, colors, or merged cells from your data, because these do not transfer to CSV and can cause the import to fail silently. Delete any rows you do not need, including notes or examples. Once your data is clean, save the file as CSV: go to File > Save As, choose the CSV (Comma delimited) format, and give it a simple name without spaces — something like constants_import.csv.
Open the Niagara Workbench and locate the import tool
Launch Niagara Station and open your project in the Workbench. Navigate to the module or folder where you want the constants to live. Right-click on the folder and look for an option labeled Import or Import Wizard — the exact name depends on your Niagara version, but it will be in the context menu.
If you do not see an Import option, check the top menu bar under File or Tools. Some versions of Niagara place the import function in the main menu rather than the right-click menu. Once you find it, click to open the Import Wizard dialog.
Select your CSV file and configure the import settings
The Import Wizard will ask you to browse for a file. Navigate to your constants_import.csv file and select it. Niagara will read the file and display a preview of the data in the next step of the wizard.
In the preview, you will see your rows and columns displayed. Check that the header row is recognized correctly — Niagara should show your column names (ConstantName, DataType, ConstantValue) at the top. If the header row is treated as data instead, look for a checkbox or option that says First row contains headers and enable it. This tells Niagara to skip the header row and treat only the data rows as imports.
Map CSV columns to Niagara constant properties
The next step in the wizard is the mapping screen. This is where you tell Niagara which CSV column corresponds to which constant property. You will see your CSV columns listed on the left and Niagara's expected fields on the right. Drag or select to match them: your ConstantName column maps to the Name field, DataType maps to Type, and ConstantValue maps to Value.
If your CSV has extra columns you do not need (such as a Description or Notes column), you can leave them unmapped — Niagara will ignore them. If a required field has no mapping, the wizard will warn you before proceeding. Do not skip this step by guessing; an incorrect mapping will create constants with wrong values or types, and you will have to delete them and start over.
Review and execute the import
Before clicking the final Import or Finish button, review the summary screen. It will show you how many constants will be created and list any warnings or errors it found. If you see errors, go back and fix the mapping. Common errors include data type mismatches (for example, trying to import the text "true" into a boolean field) or missing values in required columns.
Once the summary looks correct, click Import or Finish. Niagara will create the constants in your selected folder. The process usually takes a few seconds for small batches. When it completes, you will see a confirmation message. Check your folder in the Workbench to verify that the constants appear with the correct names and values.
Verify the imported constants and troubleshoot common issues
After import, click on one of your new constants to open its properties and confirm the value and data type are correct. If a constant shows the wrong value or type, delete it and check your CSV file for the error — common causes are extra spaces in the CSV cells, mismatched data type names (Niagara uses specific names like "BBoolean" or "BInt" depending on version), or values that do not match their declared type.
If the import created no constants at all, the most likely cause is that Niagara could not parse your CSV file. This happens when the file contains special characters, line breaks within cells, or inconsistent delimiters. Open the CSV file in a text editor (not Excel) to check for these issues. You can also try re-exporting from Excel and making sure the delimiter is set to comma, not semicolon or tab.
Frequently Asked Questions
Can I import constants directly from an Excel file without converting to CSV?
No, Niagara's import tool reads CSV format only. You must save your Excel file as CSV before importing. This is a one-time step and takes less than a minute.
What data types does Niagara accept for constants?
Common types include int (integer), float (decimal number), string (text), and bool (true/false). Your Niagara version may support additional types. Check your system documentation or look at existing constants in your project to see which type names are used.
What happens if I import a constant with the same name as one that already exists?
Niagara will either overwrite the existing constant or create a duplicate with a modified name, depending on your version and import settings. To avoid this, check your folder for existing constants before importing, or import into an empty folder.
Can I import constants with special characters or spaces in the name?
Most Niagara systems allow spaces and some special characters in constant names, but underscores are safer and more common. Test with a single constant first if you are unsure whether your naming convention will work.
How do I undo an import if something goes wrong?
There is no built-in undo for imports. You must manually delete the constants that were created. Select them in the Workbench, right-click, and choose Delete. This is why testing with a small batch first is important.