This page describes a connector scenario by integrating the Salesforce REST Connector with the Power Bi connector. For example you can use the Salesforce REST Connector to get the account details (Eg :- Id, Name, Account type of the records in your organization) from Salesforce and add that account details into table in the dataset of Power Bi using addRows operation in the Power Bi connector.
- Get the account details from the Salesforce using query operation.
- Add the account details into the Power Bi using the addRows operation.
Environment setup for running the above use cases
- Download ESB 5.0.0 from here.
- Upload the following connectors to the ESB:
- Follow the instructions given in the developer guide of the above connectors.
- Import the certificate into the ESB client keystore to use the Salesforce REST connector. Refer this link to import the certificate.
- Creating the credentials to use the Power Bi Connector:
- Create a Office 365 E3 trial account.
- Navigate to the URL https://login.microsoftonline.com/login.srf and login with Microsoft account which is created in step 1 .
- Navigate to the URL https://powerbi.microsoft.com/en-us/ and signup for a Power Bi account using the previously created Microsoft account.
- Create a dataset and keep the dataset name for further use.
- Enable PowerBI pro by using the popup by selecting the "Create Group" option.
- Create a group in PowerBI.
- Navigate to the URL https://app.powerbi.com/apps.
Step 1 - Login using Power BI account which used in step 2 .
Step 2 - Provide App Name, Redirect URL, App Type and Home Page URL and for App Type use "Server-side Web app". Note Redirect URL for further use.
Step 3 - select all the check boxes to enable access for the api.
Step 4 - Click "Register App" and note client-id and client-secret that are returned for further use.
- Generate the authorization code by sending a GET request using url https://login.windows.net/common/oauth2/authorize?response_type=code&client_id=<client-id>&resource=https://analysis.windows.net/powerbi/api&redirect_uri=<Redirect URL>.
- First, create a developer account in Salesforce using https://developer.salesforce.com/signup
- After, you need to create a connected app to get the clientId, clientSecret for getting the accessToken and refreshToken to access the Salesforce API.
If you have a Developer Edition account, log in to salesforce.com with your developer credentials, navigate to Setup ➤ Create ➤ Apps, and in the Connected Apps section, click Newto create a new connected App.Then, Provide the App name, callback URL, Check Enable OAuth Settings to expand the API section and select the OAuth Scopes as below.From these steps, you will get the Consumer key(Client ID) and Consumer Secret(Client Secret) for your app.
- Copy the following URL and paste it into a web browser URL bar and you have to replace the <your_client_id> and <your_redirect_uri> with the created app values. Then, you need to approve the application to access your salesforce account.
- After, successful authorization, the user's browser is redirected back to the redirect URI at the client application, with a URL of the form:
The client application can now extract the authorization code from its URL parameter.
For that you just copy the below URL with the respected values for the application that created above. You can set format as urlencoded, json or xml to getting the response as the specified format option.From the above response, you can get the accessToken to access the salesforce organization via the created app and refreshToken to refresh the accessToken when it will be expired.https://login.salesforce.com/services/oauth2/token?code=
Following is a sample proxy service that illustrates how to test the above scenario.