Export Data from Forecast to Excel via the API
Time to read: 10 minutes
- This article really shows the power of the Forecast API
- You can export data by obtaining an API-key from Forecast, and connecting it to Excel
- Here you will find a guide to navigating you through the steps to connect and import your data into Excel
- The great thing about this guide is that you only have to go through it once. From then after you just ask Excel to refresh the data based on your current setup using the Refresh All button in the Data tab
Set Up Inquiries in Microsoft Excel
Step 1: Open Excel, and create a blank workbook
Step 2: Go to the Data tab in the menu at the top of Excel. Click New Query, and select From Other Sources → From Web.
Step 3: Click Advanced in the new window
Step 4: Go to the Admin Settings in Forecast using your personal menu at the top right
Step 5: Go to the API-keys tab and click Generate new API-key
Note: Your new API key will be generated automatically
Step 6: Copy the new API-key, and go back to Excel
Step 7: Add the information as showcased in the screenshot above, i.e. URL and the GET name of the data you wish to export from Forecast.
- URL: https://api.forecast.it/api/v1/
- GET name: e.g. "projects", "persons", or "time_registrations"
Also, remember about the Parameters at the bottom of the window, or find the information using the GitHub repository with our API guidelines.
- HTTP request header parameters: "X-FORECAST-API-KEY" and your unique API-key from Forecast in the second field
Then, click Ok
Step 8: The data has now been downloaded. Click To Table...
Step 9: Click OK
Step 10: Click the small button at the top right of the first column as shown in the screenshot below. Check or uncheck data as you see fit, and click OK.
Step 11: The data will now show up in your spreadsheet.
Step 12: Right-click on the new item in the right sidebar, and go to Properties to rename the data set and enable/disable data points if necessary. A good practice is also to rename the tab/sheet at the bottom if you plan to work with several data sets.
Step 13: Click Close & Load when you are done.
Step 14: You can add more data sets to the same file which makes you able to link data sets, e.g. Person ID with that particular person's time registrations using the "persons" and "time_registrations" API endpoints. Additionally, you can get a better visual view by using the Pivot Table feature.
Remember to name the tabs properly to distinguish later on.