cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AvenaFernando Helper II
Helper II

How to show in the gallery something selected in the dropdown

I have two spreadsheets, with unique_id as the primary key.

 

Dropdown Spreadsheet

pagina1.png

 

Text Gallery Worksheet

pagina2.png

 

In Dropdown --> Itens: Distinct(Descricao_KBLv;UNIQUE_ID_HIF)

and GalleryTextItens --> Filter(Produtos_KBLv;DropKBL.Selected.Value in UNIQUE_ID_HIF)

 

But I can not in the dropdown show the names of the column: Description

b.pngk.png

 

As in the dropdown show the values in the Description column, but using the unique_id column to filter only the respective items in the Text Gallery.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: How to show in the gallery something selected in the dropdown

Hey AvenaFernando,

 

I think I've got a solution that will accomplish what you want. Follow my example below and it should demonstrate how to do this.

 

First, I need to set up some collections to mimic the data you're using. Since you've already connected to your data sources (the tables from your spreadsheets), you can skip this step. I've created a button and set its "OnSelected" property to the following:

ClearCollect(Areas, {UNIQUE_ID_HIF: "C77EB18C", Description: "Kitchen"}, {UNIQUE_ID_HIF: "166C5BEF", Description: "Bathroom"}, {UNIQUE_ID_HIF: "26321A12", Description: "Living Room"});
ClearCollect(Products, {UNIQUE_ID_PRODUTOS: "AB3EEDD3", UNIQUE_ID_HIF: "C77EB18C", Description: "Cooker"}, {UNIQUE_ID_PRODUTOS: "AEBD1FCA", UNIQUE_ID_HIF: "C77EB18C", Description: "Microwave"}, {UNIQUE_ID_PRODUTOS: "5248DF28", UNIQUE_ID_HIF: "166C5BEF", Description: "Towel"}, {UNIQUE_ID_PRODUTOS: "C011E04F", UNIQUE_ID_HIF: "166C5BEF", Description: "Shower"}, {UNIQUE_ID_PRODUTOS: "DF70A0B5", UNIQUE_ID_HIF: "26321A12", Description: "Couch"})

Now, when I click that button, I'll have 2 collections, "Areas" and "Products", to work with.

 

Next, I create the first of two dropdowns. I named this dropdown "AreaSelector". I set its "Items" property equal to "Areas". Then, under the advanced sidebar UI, I set the "Value" property (under "Data" and "Items") to "Description". This way, the dropdown will display only the description field for each record.

 

Next, I create our second dropdown. I named this dropdown "ProductSelector". I set its "Items" property to the following:

Filter(Products, UNIQUE_ID_HIF = AreaSelector.Selected.UNIQUE_ID_HIF)

This ensures that only items which match our currently selected area will be displayed in this dropdown menu. After that, I once again go into the advanced sidebar UI and make sure that my dropdown is displaying the "Description" field and not something else.

 

Let me know if you have any questions,

  Maxwell, PowerApps-Staff

View solution in original post

7 REPLIES 7
Super User
Super User

Re: How to show in the gallery something selected in the dropdown

Hey @AvenaFernando

 

 

I think I have a solution for your problem.

So try this in the Default from your dropdown DataCardValue:

First(<Source>).<ColumnToShow>

So in your case this will be:

First(Descricao_KBLv).Description

and then choose for value1 Value to show

I hope this helps

 

Just test my own solution and it works for only 3 seconds, if you select a new value it doesn't work

Sorry for this inconvenience

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Highlighted
AvenaFernando Helper II
Helper II

Re: How to show in the gallery something selected in the dropdown

I tried to put: First (Description_KBLv) .Description - no Default, but did not work.

AvenaFernando Helper II
Helper II

Re: How to show in the gallery something selected in the dropdown

In link - https://1drv.ms/x/s!AijLzG3PzbarfcNfbmMVkoQdLX0 - worksheet that I am using to do.

 

Would have like someone to make the application in powerapps and make available for study.

Microsoft
Microsoft

Re: How to show in the gallery something selected in the dropdown

Hey AvenaFernando,

 

I think I've got a solution that will accomplish what you want. Follow my example below and it should demonstrate how to do this.

 

First, I need to set up some collections to mimic the data you're using. Since you've already connected to your data sources (the tables from your spreadsheets), you can skip this step. I've created a button and set its "OnSelected" property to the following:

ClearCollect(Areas, {UNIQUE_ID_HIF: "C77EB18C", Description: "Kitchen"}, {UNIQUE_ID_HIF: "166C5BEF", Description: "Bathroom"}, {UNIQUE_ID_HIF: "26321A12", Description: "Living Room"});
ClearCollect(Products, {UNIQUE_ID_PRODUTOS: "AB3EEDD3", UNIQUE_ID_HIF: "C77EB18C", Description: "Cooker"}, {UNIQUE_ID_PRODUTOS: "AEBD1FCA", UNIQUE_ID_HIF: "C77EB18C", Description: "Microwave"}, {UNIQUE_ID_PRODUTOS: "5248DF28", UNIQUE_ID_HIF: "166C5BEF", Description: "Towel"}, {UNIQUE_ID_PRODUTOS: "C011E04F", UNIQUE_ID_HIF: "166C5BEF", Description: "Shower"}, {UNIQUE_ID_PRODUTOS: "DF70A0B5", UNIQUE_ID_HIF: "26321A12", Description: "Couch"})

Now, when I click that button, I'll have 2 collections, "Areas" and "Products", to work with.

 

Next, I create the first of two dropdowns. I named this dropdown "AreaSelector". I set its "Items" property equal to "Areas". Then, under the advanced sidebar UI, I set the "Value" property (under "Data" and "Items") to "Description". This way, the dropdown will display only the description field for each record.

 

Next, I create our second dropdown. I named this dropdown "ProductSelector". I set its "Items" property to the following:

Filter(Products, UNIQUE_ID_HIF = AreaSelector.Selected.UNIQUE_ID_HIF)

This ensures that only items which match our currently selected area will be displayed in this dropdown menu. After that, I once again go into the advanced sidebar UI and make sure that my dropdown is displaying the "Description" field and not something else.

 

Let me know if you have any questions,

  Maxwell, PowerApps-Staff

View solution in original post

AvenaFernando Helper II
Helper II

Re: How to show in the gallery something selected in the dropdown

Thanks Maxwell, it worked perfectly. I created an application with data and using the filter in different places.

 

Dropdown, Text Gallery and ListBox and it worked fine.

 

In the url is the application.

https://1drv.ms/f/s!AijLzG3Pzbarf_cd4Wg8MnVCXsQ

AvenaFernando Helper II
Helper II

Re: How to show in the gallery something selected in the dropdown

A doubt appeared.

 

The filter works, but how to have it and have the search and classification

 

Filter(Products, UNIQUE_ID_HIF = AreaSelector.Selected.UNIQUE_ID_HIF)

And 

Sort(If(IsBlank(TextSearchBox1.Text); Products; Filter(Products;TextSearchBox1.Text in Text(Description)));Description; If(SortDescending1; SortOrder.Descending; SortOrder.Ascending))

How to keep several formulas together?
 

 

Microsoft
Microsoft

Re: How to show in the gallery something selected in the dropdown

Hey AvenaFernando,

 

  Let me see if I understand what you're trying to accomplish.

 

  1. We've got the two drop downs that we were working with previously.
  2. We've also got a text box ("TextSearchBox1") that we want to use to filter our products (which are already filtered by area).
  3. Finally, we've got a checkbox (or something similar) that determines whether we're sorting the data in ascending or descending order.

  Does that sound right?

 

Thanks in advance,

  Maxwell, PowerApps-Staff

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,816)