Microsoft Power Apps


Microsoft Power Apps


You can connect Microsoft Power Apps to CData Connect via the Virtual SQL Server API or via the OpenAPI specification.

Prerequisites

Before you connect via Virtual SQL Server API, you must first do the following:

  • Connect a data source to your CData Connect account. See Connections for more information.
  • Generate a Personal Access Token (PAT) on the Settings page. Copy this down, as it acts as your password during authentication.

Connect via the Virtual SQL Server API

To establish a connection from Microsoft Power Apps to the CData Connect Virtual SQL Server API, follow these steps.

  1. Log in to Microsoft Power Apps.

  2. In the navigation menu, open Dataverse > Connections.

  3. Click New connection to open the list of available connections.

  4. Select SQL Server. In the dialog that appears, select SQL Server Authentication.

  5. Enter the connection settings.
    • SQL server name—enter the Virtual SQL Server endpoint and port separated by a comma: tds.cdata.com,14333
    • SQL database name—enter the Connection Name of the CData Connect data source you want to connect to (for example, Salesforce1).
    • Username—enter your CData Connect username. This is displayed in the top-right corner of the CData Connect interface. For example, test@cdata.com.
    • Password—enter the PAT you generated on the Settings page.
    • Leave the Choose a gateway field blank.

  6. Click Create to establish the connection.

Your connection now appears in your connection list. You can add more data sources from your CData Connect account by repeating this process and entering a different SQL database name.

Learn More

For more information about SQL Server connections in Microsoft Power Apps, please see Microsoft’s support article.

Connect via OpenAPI

To establish a connection from Microsoft Power Apps to the CData Connect via OpenAPI, follow these steps.

  1. In Virtual Datasets in CData Connect, select a workspace and download the OpenAPI specification for the workspace. See OpenAPI for more information.

  2. Log in to Microsoft Power Apps.

  3. Select Custom connectors to create a custom connector (you may need to click Discover all to find Custom connectors).

  4. Select New custom connector > Import an OpenAPI file.

  5. Enter a Connector name and import the OpenAPI specification file you downloaded.

  6. In the General step, enter general information about the connector, including a description. Host and Base URL are required, but are already filled in.

  7. In the Security step, select an Authentication type of Basic authentication. Users have to provide a user name and password before using this API.

  8. The Definition step of the connector defines all the actions of the connector that are contained in the OpenAPI specification file. The actions include all the functions you need for the table, including list, get, create, update, and delete records.

    In the Definition step, you can edit the Actions, References, and Policies imported from the OpenAPI specification.

    • Actions—each action in the custom connector has General information, as well as the Request, Response, and Validation of the response.

      For example, the following request is a GET request to list drives.

      The request includes query parameters that are appended to the URL, such as $top, $filter, and $orderby. You can edit and delete the query parameters here. The parameters are based on the OData protocol.

      See API Operations for a complete reference.

      The Test step of creating a custom connector is where you can test out the query parameters.

      Similarly, there is a POST request to create a new record. The request contains all the fields for the record. You can edit these fields in the definition.

    • References—reusable parameters that are used by both actions and triggers. Each reference has a Definition and Validation.

    • Policies—used to change the behavior of actions through configuration.

  9. Save the custom connector.

  10. In the Test step, you can test the behavior of each operation defined in the OpenAPI specification by applying query parameters.

    For example, you can test the $top and $orderby query parameters by returning the top 100 records, ordered by name.

  11. You can now build apps with your custom connector.