Import constants directly from an Excel file into Niagara by using the CSV import feature in the Niagara Framework

Niagara does not have a native Excel importer, but you can move constants from Excel into Niagara by saving your Excel file as a CSV (comma-separated values) file and then importing it through Niagara's data import tools. The process takes about five minutes once you have your Excel data formatted correctly. You will need the Niagara Framework installed on your machine and access to the station where you want the constants to live.

The fastest route is to export your constants from Excel as CSV, then use Niagara's import wizard to map the columns to the correct fields. This method works for both straightforward constant lists and more complex data structures, as long as your Excel columns match Niagara's expected format.

Key Takeaways

  • Save your Excel file as a CSV file before importing — Niagara's import tool reads CSV format, not native Excel files.
  • Your CSV must have a header row with column names that match Niagara's field names, such as "name", "type", and "value".
  • Use Niagara's import wizard by opening your station, navigating to the constants module, and selecting the import option from the menu.
  • Test the import on a small batch of constants first to catch formatting errors before you import your entire dataset.

Prepare your Excel file and save it as CSV

Open your Excel spreadsheet and arrange your constants in columns. At minimum, you need three columns: one for the constant name, one for the data type (such as "int", "string", or "bool"), and one for the value itself. Add a header row at the top with clear names like "name", "type", and "value" — Niagara's importer will look for these labels.

Check that each row contains only one constant and that there are no blank rows in the middle of your data. Remove any formatting like colors, merged cells, or formulas — the importer reads only the raw cell values. Once your data is clean, go to File > Save As, choose CSV (Comma delimited) as the file type, and save the file to a location you can find easily, such as your Desktop or Documents folder.

Open Niagara and navigate to the constants module

Launch Niagara Framework and open the station where you want to import the constants. In the left panel, find and expand the Modules section, then locate the Constants module. If you do not see a Constants module, you may need to create one first — right-click on the Modules folder, select New Module, and name it "Constants".

Once the Constants module is open, look for an import option in the menu bar or by right-clicking in the module window. Different versions of Niagara may place this option in slightly different locations, but it is usually labeled "Import" or "Import Data". If you cannot find it, check the Help menu or your Niagara documentation for the exact location in your version.

Use the import wizard to map your CSV columns

Click the import option and a dialog will open asking you to select your CSV file. Navigate to the file you saved and open it. Niagara will read the header row and show you a preview of your data. The wizard will then ask you to map each column in your CSV to a field in Niagara — for example, telling it which column contains the constant name and which contains the value.

Match each CSV column to the correct Niagara field. If your CSV has a "name" column and Niagara expects a field called "constantName", select the mapping that connects them. The wizard usually auto-detects these matches if your column headers are clear, but you can adjust them manually if needed. Once the mapping is correct, click Next or Import to proceed.

Review the import preview and confirm

Before the import runs, Niagara will show you a preview of what will be imported. Check that the constant names, types, and values all look correct. If you see errors — such as a value in the wrong column or a data type mismatch — cancel the import, fix the CSV file, save it again, and start over. It is faster to fix the source file than to delete and re-import bad data.

Once you are confident the preview is correct, click the final Import or Confirm button. Niagara will create the constants in your module. The import usually completes in seconds, and you will see a confirmation message showing how many constants were imported.

Verify the imported constants in Niagara

After the import finishes, open the Constants module and scroll through the list to spot-check a few constants. Verify that the names match what you intended, the values are correct, and the data types are assigned properly. If a constant looks wrong, you can edit it directly in Niagara by double-clicking it and changing the value or type.

If the entire import failed or only part of it succeeded, check the error log in Niagara — it usually appears in a message window or in the station's log file. Common errors include mismatched column names, unsupported data types, or blank rows in the CSV. Fix the CSV file and try the import again.

Troubleshoot common import errors

If Niagara does not recognize your CSV file, make sure you saved it as CSV and not as an Excel file with a .csv extension. Open the file in a text editor like Notepad to confirm it contains comma-separated values, not Excel formatting. If the columns are not mapping correctly, check that your header row uses the exact field names Niagara expects — spaces, capitalization, and spelling all matter.

If some constants import but others do not, look for blank rows, special characters, or values that do not match the declared data type. For example, if you declare a column as "int" but one cell contains the word "unknown", that row will fail. Remove or fix those rows and re-import. If you are still stuck, consult your Niagara version's documentation or check the station's error log for the specific reason each row failed.

Frequently Asked Questions

Can I import constants into multiple modules at once?

No, the import wizard works on one module at a time. If you have constants for different modules, either import them separately into each module or organize your CSV so all constants for one module are together, then repeat the import process for each module.

What happens if a constant name already exists in the module?

Niagara will usually skip the duplicate or ask you whether to overwrite it. Check the import preview or the confirmation message to see what Niagara did. If you want to replace existing constants, delete them from the module first, then import the new ones.

Can I import constants with complex data types like arrays or objects?

straightforward data types like int, string, bool, and float work reliably. Complex types depend on your Niagara version and how the data is formatted in the CSV. Test with a small batch first. If complex types do not import correctly, you may need to create those constants manually or use Niagara's scripting tools instead.

Do I need to restart Niagara after importing constants?

No, imported constants are available when ready in the module. You do not need to restart the station or Niagara itself. If a constant does not appear right away, refresh the module view by closing and reopening it.