A module for fetching data from the salesforce api to populate a Power BI dashboard with Support metrics.
Report Bug
·
Request Feature
Table of Contents
A module for fetching data from the salesforce api to populate a Power BI dashboard with Support metrics.
This was originally developed for generating a weekly PowerPoint, but has been modified to be used as a service to fetch data for Power BI.
To get a local copy up and running follow these steps.
Please ensure you have the following requirements installed before going further. Failure to do so will likely prevent you from properly installing the module.
- Python 3.11.5 - Download and install from https://www.python.org/downloads/
- Git - Download and install from https://github.com/git-guides/install-git
- Microsoft Visual C++ 14.0 - Download and install from https://visualstudio.microsoft.com/visual-cpp-build-tools/
- In the Visual Studio installer, you only need to select "Desktop development with C++"
- Microsoft Power BI - Download and install from the Microsoft store or at https://powerbi.microsoft.com/en-us/downloads/
- Clone the repo
git clone https://github.com/spierce5/assetpoint-weekly-bi.git
- Change directory to the project folder
cd assetpoint-weekly-bi - Install PIP packages
pip install -r requirements.txt
Several further setup steps are required before use. Two additional files will need to be created:
- .env
- app_data.json
You can copy from .env.example and app_data.json.example respectively.
In order to connect to Salesforce, you will need to update the environment variables in .env as such:
| /.env | |
|---|---|
| Key | Description |
| SF_INSTANCE | Your organization's Salesforce domain |
| SF_USERNAME | Your Salesforce username found in Setup |
| SF_PASSWORD | Your Salesforce password |
| SF_TOKEN | Your Salesforce security token |
You will need to set a password for your Salesforce account on the Setup page. Once your password is set, you should receive an email with your security token, otherwise, you can generate a new security token manually. Read more at https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&type=5
The content of app_data.json must be valid json and must contain a key named "team_members". Within team_members, you will need to add the following information:
| /app_data.json - team_members | |
|---|---|
| Key | Description |
| name | Full name as used in Salesforce |
| preferred_name | Preferred first name e.g. Sam rather than Samuel |
| birthday | Birthday in yyyy-mm-dd format (year will not be used, but must be a valid year) |
| active | True if a current member of the team, otherwise, False |
Lastly, you will need to directly set the path in pbi_data.py to the project directory.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Sam Pierce - sam.pierce@aptean.com
Project Link: https://github.com/spierce5/assetpoint-weekly-bi