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: powerapps-docs/maker/canvas-apps/add-gallery.md
+39-45Lines changed: 39 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Show a list of items from any data source by adding a **[Gallery](controls/contr
27
27
28
28
2. Upload the Excel file to a [cloud-storage account](connections/cloud-storage-blob-connections.md), such as OneDrive for Business.
29
29
30
-
## Add a Gallery control
30
+
## Open a blank app
31
31
1. Open PowerApps, and then click or tap **New** near the left edge.
32
32
33
33
2. On the **Blank app** tile, click or tap **Phone layout**.
@@ -36,30 +36,25 @@ Show a list of items from any data source by adding a **[Gallery](controls/contr
36
36
37
37
4. [Add a connection](add-data-connection.md) to the **FlooringEstimates** table in the Excel file.
38
38
39
-
5. (optional) Add a **Gallery** control to the default screen by clicking or tapping the **Insert** tab, clicking or tapping **Gallery**, and then clicking or tapping a **Gallery** control that's empty (blank) or that contains a default set of controls.
39
+
## Add a gallery to a blank screen
40
40
41
-
These options include **Gallery** controls that scroll horizontally or vertically. You can also add a **Gallery** control that automatically bases its size on the amount of content in each item.
41
+
1. On the **Insert** tab, select **Gallery**, and then select the **Vertical** option that contains controls.
7. Click or tap **List screen** to add a screen that contains a **Gallery** control and other controls such as a search bar.
49
+
1. (optional) In the **Layout** list, select a different option.
50
50
51
-
> [!NOTE]
52
-
> Whether you add a **Gallery** control to a new screen or an existing one, you can click or tap near the bottom of the **Gallery** control to select it, click or tap **Flooring Estimates** in the right-hand pane, and then click or tap a different layout in the **Data** pane. For this tutorial, leave the default layout.
1. Set the gallery's **Items** property to `FlooringEstimates`.
63
58
64
59
The **Gallery** control shows the sample data.
65
60
@@ -77,55 +72,54 @@ Before you do any customization, decide on a **Gallery** control layout. The fir
77
72
2. With the template still selected, add a **[Label](controls/control-text-box.md)** control, and then move and resize it so that it doesn't overlap with other controls in the template.
The **[Items](controls/properties-core.md)** property of a **Gallery** control determines which items it shows. In this procedure, you configure that property so that the **Gallery** control shows only those items for which the product name contains the text in **TextSearchBox1**.
1. Select the **Gallery** control by clicking or tapping near the bottom of that control.
100
-
101
-
2. On the **Advanced** tab, set the **[Items](controls/properties-core.md)** property of the **Gallery** control to this formula:
88
+
## Filter and sort a gallery
89
+
The **[Items](controls/properties-core.md)** property of a **Gallery** control determines which items it shows. The same property can also determine in what order the data appears and which records appear based on filter criteria. In this procedure, you configure that property so that the **Gallery** control shows only those items for which the product name contains the text in **TextSearchBox1**.
102
90
103
-
**If(IsBlank(TextSearchBox1.Text), FlooringEstimates, Filter(FlooringEstimates, TextSearchBox1.Text in Text(Name)))**
104
-
105
-
For more information about the functions in this formula, see the [formula reference](formula-reference.md).
106
-
107
-
3. Type part or all of a product name in the search box.
108
-
109
-
The **Gallery** control shows only those items that meet the filter criterion.
110
-
111
-
## Sort the Gallery control
112
-
The **[Items](controls/properties-core.md)** property of a **Gallery** control determines the order in which it shows items. In this procedure, you configure that property so that the **Gallery** control shows the order of items as set by **ImageSortUpDown1**.
113
-
114
-

91
+

115
92
116
93
1. Set the **[Items](controls/properties-core.md)** property of the **Gallery** control to this formula:
117
94
118
-
**Sort(If(IsBlank(TextSearchBox1.Text), FlooringEstimates, Filter(FlooringEstimates, TextSearchBox1.Text in Text(Name))), Name, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))**
95
+
```powerapps-dot
96
+
Sort
97
+
(If
98
+
(IsBlank(TextSearchBox1.Text),
99
+
FlooringEstimates,
100
+
Filter(
101
+
FlooringEstimates,
102
+
TextSearchBox1.Text in Text(Name)
103
+
)
104
+
),
105
+
Name,
106
+
If(
107
+
SortDescending1,
108
+
SortOrder.Descending,
109
+
SortOrder.Ascending
110
+
)
111
+
)
112
+
```
119
113
120
-
2. Select the sort icon to change the sorting order of the **Gallery** control by the names of the products.
114
+
For more information about the functions in this formula, see the [formula reference](formula-reference.md).
121
115
122
-
To sort *and* filter your **Gallery** control:
116
+
1. Double-click the search box, and then type part or all of a product name.
123
117
124
-
* Replace both instances of *DataSource* in this formula with the name of your data source.
118
+
Only those items that meet the filter criterion appear.
125
119
126
-
* Replace both instances of *ColumnName* with the name of the column by which you want to sort and filter.
120
+
1. While pressing the Alt key, select the sort icon one or more times to switch the sort order.
0 commit comments