Introduction:
We've released a new version of the Auto Job Importer, simply called the Auto Importer. This new version allows you to add and update operations, as well as other data types, automatically! Avoiding the need for manual imports or double entry. This article presents the capabilities, requirements, and instructions for importing your data via CSV files.
Note: The MachineMetrics Importer is an advanced feature, and it’s recommended to have assistance from your IT department for the initial setup.
Topics covered in this article:
- Prerequisite Concepts
- Setting Up the Importer
- Importing Operations
- Creating a Windows Scheduled Task
- Troubleshooting
Prerequisite Concepts
This article presumes you have at least a basic understanding of the following concepts:
- CSV Delimited Files: If you are not familiar with the general concept of delimited files and the specific requirements of formatting CSV files, a good introduction may be found here.
- MachineMetrics Operations: The Operations article contains information on the overall function and use of Operations in MachineMetrics.
Setting Up the Importer
- Generate an API key with the ERP and Reporting scopes. Save your API Key for now, as it will be used later.
- Create a folder. It can be named anything, but a descriptive name is recommended.
- Download the file-uploader.exe. https://drive.google.com/file/d/1yTJdJsHplXeGobu-W6A-n4U8_G3Suy_x/view?usp=sharing
Note: This download may trigger security warnings from your operating system or browser. These warnings are expected and do not indicate that the file is harmful. - Open a command prompt and navigate to the location of file-uploader.exe.
- Run the following command, replacing the PATH and API_KEY values with the path folder you made in step 2 and the API key you generated in step 1, respectively. The PATH must be a full UNC path and not a relative Network Drive path.
Important: API Keys should be treated like passwords and never shared via insecure methods. The API key used in the example below has been deactivated and is, therefore, safe for us to show.file-uploader.exe -p PATH -t API_KEY
Examplefile-uploader.exe -p C:\Users\Work\Desktop\MachineMetrics\FileImporter -t st-b8d249b0fdf9bd4133fdb869c6888cd1de73799584c307c1
- The Importer is now running! As long as the command prompt is left open, the folder will be monitored for new files.
The Importer will also create a .txt file called “upload” within the top-level folder. This will contain an event log for the Importer.
Importing Operations
Now that your Importer is running let's import some data! To import operations via the Importer, you must create a CSV of your operations data in the required format.
The Auto Importer uses a similar format to the Legacy Job Importer. However, the headings will need to be in camel casing.
Example: "default_expectedparttime" should now be formatted as "defaultExpectedPartTime"
A template and example CSV are available here.
- Within the folder you created during setup, add a folder called “operations”. The name of this folder must be exactly “operations” as this is what tells the Importer what type of data you'll be trying to send.
- Place your formatted operations CSV in the operations folder.
- When a file has been uploaded, its extension will change to .DONE. If there is already a .DONE file with the same name, the new .DONE file will replace it.
That's it! Your operations have now been imported.
Creating a Windows Scheduled Task
To ensure that your Auto Importer stays up and running, we recommend using a Windows Scheduled Task to start the Auto Importer whenever your device starts. Here's how to set one up.
-
Open Task Scheduler. You can search for "Task Scheduler" in the start menu and click on the application to open it.
-
Create Basic Task: In the right pane of the Task Scheduler window, click on "Create Basic Task..."
-
Name and Description: Provide a name and a description for your task to identify it. Click "Next" when you are done.
-
Trigger: Choose when you want the task to start. We recommend on start.
-
Action: Select the "Start a program" option, which will allow you to run a command. Click "Next".
-
Start a Program:
- In "Program/script" field, enter the path to your
file-uploader.exe
.
Example:C:\Users\Work\Desktop\MachineMetrics\file-uploader.exe
. - In "Add arguments (optional)" field, enter
-p C:\Users\Work\Desktop\MachineMetrics\FileImporter -t YOUR-API-KEY
.
Don't forget to add your own API key in place of 'YOUR-API-KEY'! Then click "Next".
- In "Program/script" field, enter the path to your
-
Finish: Review your settings and click "Finish" to create the task.
Troubleshooting
Not seeing any new operation data in your MachineMetrics account?
- Double-check your CSV formatting
- Confirm you entered the correct folder path when starting the importer
- Check that your API key has both the Reporting and ERP scopes.
If none of the above resolves your issue, please reach out to support@machinemetrics.com.
Comments
0 comments
Please sign in to leave a comment.