Skip to content

Commit cd9721e

Browse files
author
Luis Cabrera
committed
Incorporating editor's feedback
1 parent f7c8743 commit cd9721e

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

articles/search/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
href: search-explorer.md
236236
- name: Special characters and partial terms
237237
href: search-query-partial-matching.md
238-
- name: Query from PowerApp
238+
- name: Query from Power Apps
239239
href: search-howto-powerapps.md
240240
- name: Syntax reference
241241
items:

articles/search/search-howto-powerapps.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@ ms.date: 03/25/2020
1515

1616
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.
1717

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.
2121

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
2323

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.
2525

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**.
28+
1. Search for **Data** > **Custom Connectors**
2829

2930
![Custom connector menu](./media/search-howto-powerapps/1-2-custom-connector.png "Custom connector menu")
3031

31-
3. Click **+ New custom connector** and then select **Create from blank**
32+
1. Click **+ New custom connector** and then select **Create from blank**.
3233

3334
![Create from blank menu](./media/search-howto-powerapps/1-3-create-blank.png "Create from blank menu")
3435

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.
3637

37-
5. Enter information in the General Page.
38+
1. Enter information in the General Page.
3839

3940
- Icon background color (for instance, #007ee5)
4041
- 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
4344

4445
![General information dialogue](./media/search-howto-powerapps/1-5-general-info.png "General information dialogue")
4546

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.
4748

4849
![Authentication type options](./media/search-howto-powerapps/1-6-authentication-type.png "Authentication type options")
4950

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"*.
5152

5253
![New action options](./media/search-howto-powerapps/1-7-new-action.png "New action options")
5354

54-
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.
5556

5657
* Select the verb `GET`
5758
* 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
6364

6465
![Import from sample](./media/search-howto-powerapps/1-8-1-import-from-sample.png "Import from sample")
6566

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

6869
![Import from sample](./media/search-howto-powerapps/1-8-2-import-from-sample.png "Import from sample")
6970

7071

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.
7273

7374
- For *search*: Set `*` as the **default value**, set **required** as *false* and set the **visibility** to *none*.
7475

@@ -92,55 +93,54 @@ There are two main steps to having a PowerApp that shows Azure Cognitive Search
9293
x-ms-visibility: internal}
9394
```
9495
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.
9697
9798
> [!TIP]
9899
> 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.
99100
100101
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.
102103
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*.
104105
105106
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.
106107
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.
108109
109110
110111
111112
112-
## Visualize Results from the Custom Connector we just created
113+
## Visualize results from the custom connector
113114
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.
114115
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**.
117117
118118
![Create canvas app](./media/search-howto-powerapps/2-1-create-canvas.png "Create canvas app")
119119
120-
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.
121121
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**.
123123
124124
125125
![Connect connector](./media/search-howto-powerapps/2-3-connect-connector.png "connect connector")
126126
127-
Now *AzureSearchQuery* is a data source that is available to be used from your application.
128-
129-
4. Navigate to the **Insert tab**, so that we can add a few controls to our form.
127+
Now *AzureSearchQuery* is a data source that is available to be used from your application.
128+
129+
1. Navigate to the **Insert tab**, so that we can add a few controls to our form.
130130
131131
![Insert controls](./media/search-howto-powerapps/2-4-add-controls.png "Insert controls")
132132
133-
5. Insert the following elements:
134-
- A Text Label with the value "Query:"
135-
- A Text Input element (call it *txtQuery*, default value: "*")
136-
- A button with the text "Search"
137-
- A Vertical Gallery called (call it *galleryResults*)
138-
133+
1. Insert the following elements:
134+
- A Text Label with the value "Query:"
135+
- A Text Input element (call it *txtQuery*, default value: "*")
136+
- A button with the text "Search"
137+
- A Vertical Gallery called (call it *galleryResults*)
138+
139139
Your form should look something like this:
140140
141141
![Controls layout](./media/search-howto-powerapps/2-5-controls-layout.png "Controls layout")
142142
143-
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**:
144144
145145
```
146146
If(!IsBlank(txtQuery.Text),
@@ -151,28 +151,28 @@ Now *AzureSearchQuery* is a data source that is available to be used from your a
151151
152152
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.
153153
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.
155155
156156
- Set **DataSource** to *azResult*.
157157
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.
159159
160160
- **Edit Fields**, and select the fields you would like to visualize.
161161
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.
163163
164164
![Gallery Fields](./media/search-howto-powerapps/2-7-gallery-select-fields.png "Gallery Fields")
165165
166-
8. Press **F5** to preview the PowerApp.
166+
1. Press **F5** to preview the app.
167167
168-
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.
169169
170170
![calculated field](./media/search-howto-powerapps/2-8-1-calculated-field.png "Calculated field")
171171
172172
173173
![Final app](./media/search-howto-powerapps/2-8-2-final.png "Final app")
174174
175-
## Next Steps
175+
## Next steps
176176
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).
178178

0 commit comments

Comments
 (0)