CData Connect AI, enables you to access Power BI XMLA data from cloud-based applications like the Salesforce and mobile applications like the Salesforce Mobile App. In this article, you will use CData Connect AI to access Power BI XMLA data through Salesforce External Services.
Connect to Power BI XMLA from Salesforce
Overview
Here is an overview of the steps:
-
Configure: (Optional) Set up your Power BI XMLA data source in CData Connect AI, add a Workspace, add assets to your Workspace, and generate a Personal Access Token (PAT).
-
Connect: Link Salesforce to CData Connect AI using OpenAPI.
-
Explore: Use your connected data in Salesforce.
Prerequisites
Ensure you have the following before starting:
-
An active Power BI XMLA account and credentials.
-
A CData Connect AI account. Log in or sign up for a free trial here.
-
A Salesforce account.
Connect to Power BI XMLA from Connect AI
CData Connect AI uses a straightforward, point-and-click interface to connect to data sources.
-
Log into Connect AI, click Sources, and then click Add Connection
π Adding a Connection
- Select "Power BI XMLA" from the Add Connection panel
π Selecting a data source
-
Enter the necessary authentication properties to connect to Power BI XMLA.
By default, use Entra ID (formerly Azure AD) to connect to Microsoft Power BI XMLA. Entra ID (formerly Azure AD) is Microsoft's multi-tenant, cloud-based directory and identity management service. It is user-based authentication that requires that you set AuthScheme to EntraID (formerly AzureAD).
For more information on other authentication schemes, refer to the Help documentation.
π Configuring a connection (Salesforce is shown)
-
Click Save & Test
-
Navigate to the Permissions tab in the Add Power BI XMLA Connection page and update the User-based permissions.
π Updating permissions
Add a Personal Access Token
When connecting to Connect AI through the REST API, the OData API, or the Virtual SQL Server, a Personal Access Token (PAT) is used to authenticate the connection to Connect AI. It is best practice to create a separate PAT for each service to maintain granularity of access.
-
Click on the Gear icon () at the top right of the Connect AI app to open the settings page.
-
On the Settings page, go to the Access Tokens section and click Create PAT.
-
Give the PAT a name and click Create.
π Creating a new PAT
-
The personal access token is only visible at creation, so be sure to copy it and store it securely for future use.
Configure Power BI XMLA Endpoints for Salesforce
After connecting to Power BI XMLA, create a workspace for your desired table(s).
-
Navigate to the Workspaces page and click Add to create a new Workspace (or select an existing workspace).
π The Workspaces page.
π Adding a new Workspace.
-
Click Add to add new assets to the Workspace.
-
Select the Power BI XMLA connection (e.g. PowerBIXMLA1) and click Next.
π Selecting an Asset (Salesforce is shown).
-
Select the table(s) you wish to work with and click Confirm.
π Selecting Tables (Salesforce is shown).
-
Make note of the OpenAPI URL for your workspace, e.g. https://cloud.cdata.com/api/openapi/v3/{workspace_name}...
Check the column data types of the selected table:
- Once the Power BI XMLA data table is added as an asset, select the asset, and note the column names and data types from the Columns tab.
π Note the column names and data types
- In the Preview tab, preview the current data in the table to be referenced later.
π Preview the current data
- Click on Users from the left panel and search for your username, e.g. [email protected]. Click on the same.
- On the Edit Users screen, grant the respective user all Permissions (Select, Insert, Update, Delete, and Execute) for the entity (workspace).
With the connection, PAT, and Workspace configured, you are ready to connect to Power BI XMLA data from Salesforce.
Connect to Power BI XMLA Data as an External Service
Create a Named Credential
Follow the steps below to connect to the OpenAPI produced by CData Connect AI with Salesforce:
- Log into Salesforce and navigate to Setup.
π Log into Salesforce and open Setup
- Search for Named Credentials in the search bar and click on it.
π Search Named Credentials
- Select New -> New Legacy.
π Select New Legacy
- Add the given details in the New Named Credential screen:
- Label: enter a label of your choice
- Name: enter a name for the named credential
- URL: https://cloud.cdata.com
- Identity Type: Named Principal
- Authentication Protocol: Password Authentication
- Username: enter your CData Connect AI username. This is displayed in the top-right corner of the CData Connect AI interface. For example, [email protected]
- Password: enter the PAT you generated on the Settings page
- Generate Authorization Header: enable the checkbox
Click Save to save the details.
π Save the Named Credential details
Create an External Service
- Now, search for External Services in the search bar and click on it.
π Search for External Services
- In the Add an External Service page, click From API Specification under Select an API Source.
π Click "From API Specification"
- In the Enter an Existing Service page, enter the given details under Modify Exiting Registration Details:
- External Service Name: enter an identifying name for your external service
- Description: enter a description of your external service (not a mandatory field)
- Service Schema: Relative URL
- Select a Named Credential: OpenAPI
- URL: copy the OpenAPI URL from Connect AI and remove https://www.cdata.com and keep the rest of the URL. Make sure the URL starts with a forward slash "/api...".
π Enter the External Service details
If the connection is successful, the message "Schema validation completed successfully!" will be displayed on the screen. Click Save & Next
- Select all the entities in the Select Operations screen. Click Next.
π Select all the Operations entities
- All the schema-generated actions are displayed in the Review External Services Actions screen. Click Finish.
π Review External Services actions
- The External Services page will display all the external services created.
π Page displaying all external services
Create a new Flow
- Search for Flows in the search bar and click on it.
- Click New Flow.
π Click New Flow
- Select Start From Scratch option and click Screen Flow.
π Start from scratch
π Start screen flow
- In the Flow Builder screen, click on the "" between Screen Flow and End.
- Select Screen from Add Element.
π Add a screen
- In the New Screen window, enter "Input Screen" in Label and the API Name will be auto-filled accordingly.
π Enter Input Screen in the Label
- Next, based on the table you want to update, note the column data types to add the components to the flow.
- Now, for the orderid column, search for the "Number" component in the Components search bar and click on it. Enter Label as "Enter Order ID" and again API Name will be auto-filled accordingly. Enable the Require checkbox and apply this for steps 9 and 10.
π Add the Order ID label
- For the ordername column, search for the "Text" component in the Components search bar and click on it. Enter Label as "Enter Order Name".
π Add the Order Name label
- For the personid column, search for the "Number" component in the Components search bar and click on it. Enter Label as "Enter Person ID".
π Add the Person ID label
- Click Done and Input Screen will be added in the Flow Builder.
π Click Done
- Now, add an element Action below the input screen in the flow.
π Add the Action element
- Under Search Actions, search and click the newly created external service, in this case, OpenAPI1.
π Search the newly created external services
- Click Create Orders.
π Create Orders
- Enter a name in Label, the API Name gets auto filled.
π Enter a name in the label
- Click on the search bar under Set Input Values for the Selected Action and select New Resource -> Variable.
π Select New Resource
π Select Variable
- In the New Resource window, enter the following details:
- Add a new element Assignment and add the Label name as "SendBody". Again, the API Name gets auto-filled.
π Add a new element "Assignment"
- Set the given values under Set Variable Values:
- Variable: Body>orderid; Operator: Equals; Value: Input Screen>Enter Order ID
- Variable: Body>ordername; Operator: Equals; Value: Input Screen>Enter Order Name
- Variable: Body>personid; Operator: Equals; Value: Input Screen>Enter Person ID
π Click variable "Body"
π Click Order ID
π Select the value as Enter Order ID
π Fill all the three variable values as shown
- Add another Screen element below the Action element.
π Add a new screen element
- Name the Label as "Display".
π Name the label as "Display"
- Under Components, search for the "Display Text" component and click on it.
- Set the API Name as "Display_Result" and in the Inside a resource search bar, select Create a new order -> response code. Click Done.
π Search "Display Text" and add an API name
π Searh the action "Create a new order" and click "responseCode"
π Click Done
- The flow is now ready. Click Save to save the flow and add a name to the Label as the flow name, in this case, "CreateOrdersPage". Click Save.
π Click Save to save the flow
π Add a flow name in the label
- The flow is displayed on the Flow Builder screen. Click on Activate to activate the flow.
π The flow is displayed on the flow builder. Click Activate
π The flow is activated
Check the flow and verify the updated details in Connect AI
- Click Debug. The Debug flow window opens. Click Run.
π Click Debug
- In the details input page, in this case, "CreateOrdersPage", enter the details (Orders ID, Orders Name, and Person ID) and click Next.
π Enter the details to be edited in the Power BI XMLA table
- The next page displays the message "200" (HTTP 200 - OK) and the right pane displays the debug details. Click Next.
π The page diplays a HTTP 200 OK message to show the entry success
- You can change the inputs or run the process again to enter new details.
π You can change the inputs and run the flow again
- Check in Connect AI if the new details are updated in the "Orders" table, as this article outlines. This completes the process.
Simplified access to Power BI XMLA data from cloud applications
At this point, you have a direct, cloud-to-cloud connection to live Power BI XMLA data from Salesforce. For more details on accessing live data from over 100 SaaS, Big Data, and NoSQL sources through cloud applications, visit our CData Connect AI page.
Reach out to our Support Team if you have any questions.