cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Displaying the image in the gallery

Dear community
I am trying to create an application that will display the values in the gallery based on filters.

 

Capture.PNG

 

The formula for "grouping" dropdown (Items):

Sort(Distinct(MenuCard;GROUPING);Result)

 

The formula for "Event Category" dropdown (Items)::

Distinct(Filter(MenuCard;GROUPING=DropDown_Grp.Selected.Result);'EVENT CATEGORY')

 

The formula for Gallery(Items)::

Distinct(Filter(MenuCard;GROUPING=DropDown_Grp.Selected.Result);'PREFERRED Platform')

 

I want the values in the gallery to be filtered based on the drop-down list "Event Category". Basically, it works, but the images are not displayed. I have added links to them in the excel data table that I use:

Capture2.PNG

If I create a new gallery without linking it to the result of the "Event Category" dropdown list, then there are images:

Capture3.PNG

 

How can I make images visible?

 

One more question: 

How to make this invisible before it will show results? 

Capture4.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @Viatsyk , 

 

Could you tell me: 

  • Do you want to filter the data in the gallery control by ‘GROUPING and EVENT CATEGORY fields? 
  • Are there records with the same value in the ‘PREFERRED Platform field? Do you want to de-duplicate them and get the first record?
  • Do you want the gallery control to be invisible when the values of two dropdown controls are blank ?

 

If the above assumptions are true , let me explain why you encountered this problem: 

The formula of the items property in the gallery cannot meet your needs.

  • Firstly, this formula only filters records through the GROUPING field.
  • Secondly, after using distinct() function, the data in gallery only has the 'PREFERRED Platform' field.

 

So, the key is to use forall() function and lookup() function to make the record contain two fields (Image and 'PREFERRED Platform' ) while removing duplicate records.

 

I've made a test for your reference:

1\ Show my test list

v-xiaochen-msft_0-1605668274046.png

 

2\ Add a dropdown control 'DropDown_Grp' to screen and set its Items property to:

Sort(Distinct(MenuCard,GROUPING),Result)

 

3\ Add a dropdown control 'Dropdown2' to screen and set its Items property to:

Distinct(Filter(MenuCard,GROUPING=DropDown_Grp.Selected.Result),'EVENT CATEGROY')

 

4\ Add a gallery control to screen and set its Items property to:

ForAll(

    Distinct(

        Filter(

            MenuCard,

            GROUPING = DropDown_Grp.Selected.Result,

            'EVENT CATEGROY' = Dropdown2.Selected.Result

        ),

        'PREFERRED Platform'

    ),

    LookUp(

        MenuCard,

        'PREFERRED Platform' = Result

    )

)

 

5\ Set visible property of the gallery control to:

If(IsBlank(DropDown_Grp.Selected.Result)&&IsBlank(Dropdown2.Selected.Result),false,true)

 

6\ The result are as follow:

v-xiaochen-msft_1-1605668274048.png

 

v-xiaochen-msft_2-1605668274049.png

 

v-xiaochen-msft_3-1605668274050.png

 

Best Regards,

Wearsky

 

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Hi @Viatsyk , 

 

Could you tell me: 

  • Do you want to filter the data in the gallery control by ‘GROUPING and EVENT CATEGORY fields? 
  • Are there records with the same value in the ‘PREFERRED Platform field? Do you want to de-duplicate them and get the first record?
  • Do you want the gallery control to be invisible when the values of two dropdown controls are blank ?

 

If the above assumptions are true , let me explain why you encountered this problem: 

The formula of the items property in the gallery cannot meet your needs.

  • Firstly, this formula only filters records through the GROUPING field.
  • Secondly, after using distinct() function, the data in gallery only has the 'PREFERRED Platform' field.

 

So, the key is to use forall() function and lookup() function to make the record contain two fields (Image and 'PREFERRED Platform' ) while removing duplicate records.

 

I've made a test for your reference:

1\ Show my test list

v-xiaochen-msft_0-1605668274046.png

 

2\ Add a dropdown control 'DropDown_Grp' to screen and set its Items property to:

Sort(Distinct(MenuCard,GROUPING),Result)

 

3\ Add a dropdown control 'Dropdown2' to screen and set its Items property to:

Distinct(Filter(MenuCard,GROUPING=DropDown_Grp.Selected.Result),'EVENT CATEGROY')

 

4\ Add a gallery control to screen and set its Items property to:

ForAll(

    Distinct(

        Filter(

            MenuCard,

            GROUPING = DropDown_Grp.Selected.Result,

            'EVENT CATEGROY' = Dropdown2.Selected.Result

        ),

        'PREFERRED Platform'

    ),

    LookUp(

        MenuCard,

        'PREFERRED Platform' = Result

    )

)

 

5\ Set visible property of the gallery control to:

If(IsBlank(DropDown_Grp.Selected.Result)&&IsBlank(Dropdown2.Selected.Result),false,true)

 

6\ The result are as follow:

v-xiaochen-msft_1-1605668274048.png

 

v-xiaochen-msft_2-1605668274049.png

 

v-xiaochen-msft_3-1605668274050.png

 

Best Regards,

Wearsky

 

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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