Hi Powerapps Community,
I have two gallery screens that I would like to nest. The first gallery ('UID Selection Gallery') shows the company names and then once clicked, I would like second gallery ('Gallery2') to show all the company's employee representatives.
I currently have a distinct and filter by user function on the 'UID Selection Gallery' and the same filter by user function on the 'Gallery2'. These codes need to be included.
UID Selection Gallery currently:
Search(Distinct(Filter('VOC Customer List_ Test File Clean_V2',(AccountManagerEmail=varUserEmail|| sales_mgr_email=varUserEmail||sales_dir_email=varUserEmail||state_dir_email=varUserEmail)),Title&": "®_name),'UID Search Box'.Text,"Result")
Gallery2 currently:
Filter('VOC Customer List_ Test File Clean_V2',(AccountManagerEmail=varUserEmail|| sales_mgr_email=varUserEmail||sales_dir_email=varUserEmail||state_dir_email=varUserEmail))
Data source: 'VOC Customer List_ Test File Clean_V2'
Gallery 1: UID Selection Gallery
Gallery 2: Gallery2
Column name required for filter: Title
Any help would be appreciated!
Solved! Go to Solution.
I think I see the issue here. Once you use Distinct() you lose the ability to filter on Title for your second gallery. There may be other ways to do this but I found that this one should work without the need for using Distinct().
//First, filter your list and create a temporary table "fltrd"
With(
{fltrd: Filter(
'VOC Customer List_ Test File Clean_V2',
Or(AccountManagerEmail=varUserEmail,
sales_mgr_email=varUserEmail,
sales_dir_email=varUserEmail,
state_dir_email=varUserEmail
)
//Then, add temp column and group on it to provide uniqueness without losing
// the rest of the data
//Then, sort on the new temp column and ungroup the rest of the data
//into a temporary table (tbl), that expose the Title in the gallery
tbl: Ungroup(
Sort(
GroupBy(
AddColumns(
fltrd,"tempcol",Concatenate(
Title,": ", reg_name
)
),
"tempcol", "restofdata"
),
grouper
),
"restofdata"
)
},
//Allows for the search of "tbl" with your Textbox.
Search(
tbl,
'UID Search Box'.Text,
"Title"
)
)
In your second gallery you can now reference Title to filter your list:
Filter(
VOC Customer List_ Test File Clean_V2', Title=Gallery1.Selected.Title,
Or(
AccountManagerEmail=varUserEmail,
sales_mgr_email=varUserEmail,
sales_dir_email=varUserEmail,state_dir_email=varUserEmail
)
)
As perhaps a more elegant way of doing this, the exact same formula for Gallery1 could be used as the items property of a dropdown and Gallery2 could be Filtered on the dropdown instead of Gallery1. This would take up much less real estate in your app.
I think I see the issue here. Once you use Distinct() you lose the ability to filter on Title for your second gallery. There may be other ways to do this but I found that this one should work without the need for using Distinct().
//First, filter your list and create a temporary table "fltrd"
With(
{fltrd: Filter(
'VOC Customer List_ Test File Clean_V2',
Or(AccountManagerEmail=varUserEmail,
sales_mgr_email=varUserEmail,
sales_dir_email=varUserEmail,
state_dir_email=varUserEmail
)
//Then, add temp column and group on it to provide uniqueness without losing
// the rest of the data
//Then, sort on the new temp column and ungroup the rest of the data
//into a temporary table (tbl), that expose the Title in the gallery
tbl: Ungroup(
Sort(
GroupBy(
AddColumns(
fltrd,"tempcol",Concatenate(
Title,": ", reg_name
)
),
"tempcol", "restofdata"
),
grouper
),
"restofdata"
)
},
//Allows for the search of "tbl" with your Textbox.
Search(
tbl,
'UID Search Box'.Text,
"Title"
)
)
In your second gallery you can now reference Title to filter your list:
Filter(
VOC Customer List_ Test File Clean_V2', Title=Gallery1.Selected.Title,
Or(
AccountManagerEmail=varUserEmail,
sales_mgr_email=varUserEmail,
sales_dir_email=varUserEmail,state_dir_email=varUserEmail
)
)
As perhaps a more elegant way of doing this, the exact same formula for Gallery1 could be used as the items property of a dropdown and Gallery2 could be Filtered on the dropdown instead of Gallery1. This would take up much less real estate in your app.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
45 | |
43 | |
38 | |
35 |
User | Count |
---|---|
261 | |
83 | |
81 | |
69 | |
69 |