0

I need to create a custom connector which will prompt me a input field so that I can pass parameter value to get my actual data from data sources. It'll prompt me input field when I try to add a data sources from power apps. Here I attached a sample image.

How I can do that?

sample image

halfer
  • 19,824
  • 17
  • 99
  • 186

3 Answers3

0

The input box that appears in the Data panel in your photo is requesting the SharePoint site url that has your data source. You should be able to copy your SharePoint site url where your data is stored and paste it in that input box to see what data is available.

Emily Kessler
  • 231
  • 1
  • 1
  • Thanks for your reply. I know it's functonality when connect with sharepoint connecotr. But I want to know how they created this connector so that whenever i want to connect with it, It'll be prompt me a input field(my custom field). – mazharul islam Dec 11 '18 at 06:31
0

There are two types of connectors in PowerApps:

  • tabular ones (those that you can use the name directly as a table, for example, as the Items property of a Gallery. For example: MySharePointList
  • "function" or "API" ones (not an official name, how I like to call them), in which you need to call a function to retrieve a value. For example: Office365.GetEmails

Currently you can only create custom connectors in the second type, so you cannot, for example, have a custom connector where you would choose a table or some other value.

You can, however, create a custom connector that takes an API key, and when a maker needs to create a new connection, they will need to pass that value, and you can use that value in your API, even if not as a key.

For example, in the API created with the OpenAPI file listed below, it defines an API key called CustomValue which is passed in the request header, so when you try to create a connection, it will ask you for that, as seen below.

Add new connection

Now every request made from that connection will have the value that you used to create the connection in the header, and it can be read from your custom API to implement your logic.

Hope this helps. You can also create a new feature request in the PowerApps Ideas board to enable this functionality without going through this workaround of using a (fake) security key.

OpenAPI Definition

{
  "swagger": "2.0",
  "info": {
    "title": "StackOverflow53690242",
    "description": "Custom connector that requires a parameter when adding to app",
    "version": "1.0"
  },
  "host": "carlosfigueirapowerapps.azurewebsites.net",
  "basePath": "/api/",
  "schemes": [
    "https"
  ],
  "consumes": [],
  "produces": [],
  "paths": {
    "/ConnectorWithParameter": {
      "post": {
        "responses": {
          "default": {
            "description": "default",
            "schema": {
              "type": "object",
              "properties": {
                "FullName": {
                  "type": "string",
                  "description": "FullName"
                },
                "CustomValue": {
                  "type": "string",
                  "description": "CustomValue"
                }
              }
            }
          }
        },
        "summary": "Test",
        "description": "Test",
        "operationId": "Test",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "FirstName": {
                  "type": "string",
                  "description": "FirstName"
                },
                "LastName": {
                  "type": "string",
                  "description": "LastName"
                }
              }
            }
          }
        ]
      }
    }
  },
  "definitions": {},
  "parameters": {},
  "responses": {},
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "in": "header",
      "name": "CustomValue"
    }
  },
  "security": [],
  "tags": []
}
carlosfigueira
  • 85,035
  • 14
  • 131
  • 171
  • Regarding the statement that "there have several custom connector where some custom input field showing when try to connect from apps". Those are not "custom connectors" in the same way you see in web.powerapps.com, under Data -> Custom Connectors. Those are connectors that are built by Microsoft (very likely in partnership with the companies that provide the service). Those connectors (built by Microsoft) have the ability to request additional information when creating a new connection. As of today, a custom connector cannot do that yet. – carlosfigueira Dec 17 '18 at 19:39
0

Actually I saw there have several custom connector where some custom input field showing when try to connect from apps. Here is an example of PoliteMail custom connector and it's looking for username, password, PoliteMail domain. How they created this type of connector?

[https://i.stack.imgur.com/ymp02.jpg]

There also have another connecotr called SFTP where it's looking for several input parameter when try to connect. Please see the attached file See attached image

  • Hi @mazharulislam, in StackOverflow if you want to ask for clarification on an answer, please post a comment in that answer instead of creating a new answer to the question. I'll add a comment to my answer with this information. – carlosfigueira Dec 17 '18 at 19:36
  • Thanks. I saw your comment which is very valuable – mazharul islam Dec 19 '18 at 07:03