You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-howto-powerapps.md
+41-41Lines changed: 41 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,26 +15,27 @@ ms.date: 03/25/2020
15
15
16
16
This document shows how to create a Power Apps custom connector so that you can retrieve search results from a search index. It also shows how to issue a search query and visualize the results from a Power App.
17
17
18
-
## Prerequisites:
19
-
1. Power Apps account access with the ability to create custom connectors.
20
-
2. We assume you have already created an Azure Search Index.
18
+
## Prerequisites
19
+
* Power Apps account access with the ability to create custom connectors.
20
+
* We assume you have already created an Azure Search Index.
21
21
22
-
There are two main steps to having a PowerApp that shows Azure Cognitive Search results. First creating a connector that can query the search index, and then updating your power app application to visualize the results returned by the connector.
22
+
## Create a custom connector to query Azure Search
23
23
24
-
## Create a Custom Connector to Query Azure Search
24
+
There are two main steps to having a PowerApp that shows Azure Cognitive Search results. First, let's create a connector that can query the search index. In the [next section](#visualize-results-from-the-custom-connector) we will update your Power Apps application to visualize the results returned by the connector.
25
25
26
-
1. Go to [make.powerapps.com](http://make.powerapps.com) and **Sign In**
27
-
2. Search for **Data** > **Custom Connectors**
26
+
27
+
1. Go to [make.powerapps.com](http://make.powerapps.com) and **Sign In**.
3. Click **+ New custom connector** and then select **Create from blank**
32
+
1. Click **+ New custom connector** and then select **Create from blank**.
32
33
33
34

34
35
35
-
4. Give your custom connector a name. (that is, *AzureSearchQuery*), and then click **Continue**. This will bring up a wizard to create your new connector.
36
+
1. Give your custom connector a name. (that is, *AzureSearchQuery*), and then click **Continue**. This will bring up a wizard to create your new connector.
36
37
37
-
5. Enter information in the General Page.
38
+
1. Enter information in the General Page.
38
39
39
40
- Icon background color (for instance, #007ee5)
40
41
- Description (for instance, "A connector to Azure Cognitive Search")
@@ -43,15 +44,15 @@ There are two main steps to having a PowerApp that shows Azure Cognitive Search
43
44
44
45

45
46
46
-
6. In the Security Page, set *API Key* as the **Authentication Type**, set the parameter label, and parameter name fields as *api-key*. For **Parameter location**, select *Header* as shown below.
47
+
1. In the Security Page, set *API Key* as the **Authentication Type**, set the parameter label, and parameter name fields as *api-key*. For **Parameter location**, select *Header* as shown below.
47
48
48
49

49
50
50
-
7. In the Definitions Page, select **+ New Action** to create an action that will query the index. Enter the value "Query" for the summary and the name of the operation ID. Enter a description like *"Queries the search index"*.
51
+
1. In the Definitions Page, select **+ New Action** to create an action that will query the index. Enter the value "Query" for the summary and the name of the operation ID. Enter a description like *"Queries the search index"*.
8. Press the **+ Import from sample** button to define the parameters and headers. Next, you will define the query request.
55
+
1. Press the **+ Import from sample** button to define the parameters and headers. Next, you will define the query request.
55
56
56
57
* Select the verb `GET`
57
58
* For the URL enter a sample query for your search index, for instance:
@@ -63,12 +64,12 @@ There are two main steps to having a PowerApp that shows Azure Cognitive Search
63
64
64
65

65
66
66
-
9. Click **Import** to automatically pre-fill the Request dialog.
67
+
1. Click **Import** to automatically pre-fill the Request dialog.
67
68
68
69

69
70
70
71
71
-
10. Complete setting the parameter metadata by clicking the **…** symbol next to each of the parameters.
72
+
1. Complete setting the parameter metadata by clicking the **…** symbol next to each of the parameters.
72
73
73
74
- For *search*: Set `*` as the **default value**, set **required** as *false* and set the **visibility** to *none*.
74
75
@@ -92,55 +93,54 @@ There are two main steps to having a PowerApp that shows Azure Cognitive Search
92
93
x-ms-visibility: internal}
93
94
```
94
95
95
-
11. On the Response section, click **"Add default response"**. This is critical because it will help **Power Apps** understand the schema of the response. Paste a sample response.
96
+
1. On the Response section, click **"Add default response"**. This is critical because it will help **Power Apps** understand the schema of the response. Paste a sample response.
96
97
97
98
> [!TIP]
98
99
> There is a character limit to the JSON response you can enter, so you may want to simplify the JSON so that it before pasting it. The important aspect schema/format of the response. The actual values in the sample response are less important and can be simplified to reduce the character count.
99
100
100
101
101
-
12. Click the **Create connector** button on the top right of the screen before you can Test it.
102
+
1. Click the **Create connector** button on the top right of the screen before you can Test it.
102
103
103
-
13. In the Test Page, click the **+ New Connection**, and enter your search service query key as the value for *api-key*.
104
+
1. In the Test Page, click the **+ New Connection**, and enter your search service query key as the value for *api-key*.
104
105
105
106
This step may take you to the out of the wizard and into the Connections page. You may want to go back to the Custom Connections editor to actually test the connection. Go to **Custom Connector** > Select the newly created Connector > … > **View Properties** > **Edit** > **4. Test** to get back to the test page.
106
107
107
-
14. Now click **Test operation** to make sure that you are getting results from your index. If you were successful you should see a 200 status, and in the body of the response you should see JSON that describes your search results.
108
+
1. Now click **Test operation** to make sure that you are getting results from your index. If you were successful you should see a 200 status, and in the body of the response you should see JSON that describes your search results.
108
109
109
110
110
111
111
112
112
-
## Visualize Results from the Custom Connector we just created
113
+
## Visualize results from the custom connector
113
114
The goal of this tutorial is not to show you how to create fancy user experiences with power apps, so the UI layout will be minimalistic. Let's create a PowerApp with a search box, a search button and display the results in a gallery control. The PowerApp will connect to our recently created custom connector to get the data from Azure Search.
114
115
115
-
1. Create new Power App
116
-
Go to the **Apps** section, click on **+ New app**, and select **Canvas**
116
+
1. Create new Power App. Go to the **Apps** section, click on **+ New app**, and select **Canvas**.
2. Select the type of application you would like. For this tutorial create a **Blank App** with the **Phone Layout**. The **Power Apps Studio** will appear.
120
+
1. Select the type of application you would like. For this tutorial create a **Blank App** with the **Phone Layout**. The **Power Apps Studio** will appear.
121
121
122
-
3. Once in the studio, select the **Data Sources** tab, and click on the new Connector you have just created. In our case, it is called *AzureSearchQuery*. Click **Add a connection**.
122
+
1. Once in the studio, select the **Data Sources** tab, and click on the new Connector you have just created. In our case, it is called *AzureSearchQuery*. Click **Add a connection**.
6. To make the **Search button** issue a query, select the button, and Paste the following action to take on **OnSelect**:
143
+
1. To make the **Search button** issue a query, select the button, and Paste the following action to take on **OnSelect**:
144
144
145
145
```
146
146
If(!IsBlank(txtQuery.Text),
@@ -151,28 +151,28 @@ Now *AzureSearchQuery* is a data source that is available to be used from your a
151
151
152
152
This action will cause the button to update a new collection called *azResult* with the result of the search query, using the text in the *txtQuery* text box as the query term.
153
153
154
-
7. As a next step, we will link the vertical gallery we created to the *azResult* collection. Select the gallery control, and perform the following actions in the properties pane.
154
+
1. As a next step, we will link the vertical gallery we created to the *azResult* collection. Select the gallery control, and perform the following actions in the properties pane.
155
155
156
156
- Set **DataSource** to *azResult*.
157
157
158
-
- Select a **Layout** that works for you based on the type of data in your index.
158
+
- Select a **Layout** that works for you based on the type of data in your index. In this case, we used the *Title, subtitle and body* layout.
159
159
160
160
- **Edit Fields**, and select the fields you would like to visualize.
161
161
162
-
Since we provided a sample result when we defined the connector, Power Apps is aware of the fields available in your index.
162
+
Since we provided a sample result when we defined the connector, the app is aware of the fields available in your index.
Remember that the fields can be set to calculated values. For the example below, I calculated the full path of my images as the concatenation of the root path for the data and the name of the file as an example.
168
+
Remember that the fields can be set to calculated values. For the example below, the full path to the image files is calculated as the concatenation of the root path for the data and the file name.

174
174
175
-
## Next Steps
175
+
## Next steps
176
176
177
-
To learn more about creating your own PowerApps, check the [PowerApps Learning Catalog](https://docs.microsoft.com/powerapps/learning-catalog/get-started)
177
+
For more information and online training, see [Power Apps Learning Catalog](https://docs.microsoft.com/powerapps/learning-catalog/get-started).
0 commit comments