Skip to content

Commit d60ac3f

Browse files
committed
reworked add-gallery to match current UI
1 parent 0b3b72d commit d60ac3f

File tree

9 files changed

+39
-45
lines changed

9 files changed

+39
-45
lines changed

powerapps-docs/maker/canvas-apps/add-gallery.md

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Show a list of items from any data source by adding a **[Gallery](controls/contr
2727

2828
2. Upload the Excel file to a [cloud-storage account](connections/cloud-storage-blob-connections.md), such as OneDrive for Business.
2929

30-
## Add a Gallery control
30+
## Open a blank app
3131
1. Open PowerApps, and then click or tap **New** near the left edge.
3232

3333
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
3636

3737
4. [Add a connection](add-data-connection.md) to the **FlooringEstimates** table in the Excel file.
3838

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
4040

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

43-
![Add gallery](./media/add-gallery/gallery-dropdown.png)
43+
![Add vertical gallery](./media/add-gallery/gallery-dropdown.png)
4444

45-
6. On the **Home** tab, click or tap **New screen**.
45+
1. On the **Properties** tab of the right-hand pane, open the **Items** list, and select **Flooring Estimates**.
4646

47-
You can add a screen that's empty, that scrolls, that contains a **Gallery** control, or that contains a form.
47+
![Flooring estimates](./media/add-gallery/select-layout.png)
4848

49-
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.
5050

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.
51+
## Add a gallery in a screen
5352

54-
![Choose gallery layout](./media/add-gallery/select-layout.png)
53+
1. On the **Home** tab, select **New screen** > **List screen**.
5554

56-
8. Click or tap the **Gallery** control in the screen that you just added.
55+
A screen that contains a **Gallery** control and other controls, such as a search bar, appears.
5756

58-
9. On the **Properties** tab of the right-hand pane, click or tap **CustomGallerySample**.
59-
60-
10. In the **Data** pane, click or tap **CustomGallerySample**, and then click or tap **FlooringEstimates**.
61-
62-
![Select datasource](./media/add-gallery/choose-data.png)
57+
1. Set the gallery's **Items** property to `FlooringEstimates`.
6358

6459
The **Gallery** control shows the sample data.
6560

@@ -77,55 +72,54 @@ Before you do any customization, decide on a **Gallery** control layout. The fir
7772
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.
7873

7974
![Add label](./media/add-gallery/add-text-box.png)
80-
3. Open the **Data** pane by selecting the template and then clicking or tapping **Flooring Estimates** in the right-hand pane.
75+
76+
3. Select the gallery, and then select **Edit** next to **Fields** on the **Properties** tab of the right-hand pane.
8177

8278
4. Select the label that you added earlier in this procedure, and then open the highlighted list in the **Data** pane.
8379

8480
![Open drop-down list](./media/add-gallery/open-dropdown.png)
8581

8682
5. In that list, click or tap **Price**.
8783

88-
![Change label binding](./media/add-gallery/change-binding.png)
89-
9084
The **Gallery** control shows the new values.
9185

9286
![Final Gallery](./media/add-gallery/final-gallery.png)
9387

94-
## Filter the Gallery control
95-
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**.
96-
97-
![Text search box](./media/add-gallery/text-search-box.png)
98-
99-
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**.
10290

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-
![Image for sorting](./media/add-gallery/image-sorting.png)
91+
![Search box and sort icon](./media/add-gallery/text-search-box.png)
11592

11693
1. Set the **[Items](controls/properties-core.md)** property of the **Gallery** control to this formula:
11794

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+
```
119113

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).
121115

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

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

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

128-
**Sort(If(IsBlank(TextSearchBox1.Text),** *DataSource*, **Filter(** *DataSource*, **TextSearchBox1.Text in Text(** *ColumnName* **))),** *ColumnName*, **If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))**
122+
The records toggle between ascending and descending alphabetical order based on the product name.
129123

130124
## Highlight the selected item
131125
Set the **Gallery** control's **TemplateFill** property to a formula that's similar to this example:
Loading
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)