web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery does not displ...
Power Apps
Unanswered

Gallery does not display any items.

(0) ShareShare
ReportReport
Posted on by 40

I created three buttons to filter my Gallery. I make all three buttons with Set(SelectedType, "Contracts"), Set(SelectedType, "Insurance Policy"), Set(SelectedType, "Licenses Renewal"). Then the Gallery only display ThisItem.Title, ThisItem.LicenseType.Value  that with the filter category above. 

 

I set this code in "Item" property - 
SortByColumns(
              Search(
                         Filter(
                                  'Renewal Licenses',
                                  If(
                                     !IsBlank(SelectedType) && SelectedType = "Contracts",
                                      LicenseType.Value = "Contracts",
                                     !IsBlank(SelectedType) && SelectedType = "Insurance Policy",
                                      LicenseType.Value = "Insurance Policy",
                                     !IsBlank(SelectedType) && SelectedType = "License Renewal",
                                      LicenseType.Value = "License Renewal",
                                     true
                                    )
                                ),
          SearchItemInput.Text,
          "Title"),
          Ascending
)

 

Unfortunately, it doesn't display any item in the Gallery. Also, I received the delegating error for the formula by using "Filter(" function. 

 

Any suggestion or solution to solve the issues above?

Annotation 2020-03-10 100914.png
Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Kentgladwin99 

    I have parsed it below with my suggested corrections

    SortByColumns(
     Search(
     Filter(
     'Renewal Licenses',
     If( 
     !IsBlank(SelectedType) || //needs OR here 
     SelectedType = "Contracts",
     LicenseType.Value = "Contracts"
     ,
     SelectedType = "Insurance Policy",
     LicenseType.Value = "Insurance Policy"
     ,
     SelectedType = "License Renewal",
     LicenseType.Value = "License Renewal",
     )
     ),
     SearchItemInput.Text,
     "Title"
     ),
     Ascending
    )

    A couple of things - you could never get a result with  

    !IsBlank(SelectedType) && SelectedType = "Contracts"

    as both possibilities could never be true together - note I have used || (or)

    Secondly, you can only put the blanks in one category

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Kentgladwin99 Profile Picture
    40 on at

    Hi @WarrenBelz ,

    Thank you for your suggestion. But the script gives me error at the  "IF" section. 

  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Kentgladwin99 ,

    Extra comma after licence renewal not required - see below. My post was more about showing you the issue rather than writing the code.

    SortByColumns(
     Search(
     Filter(
     'Renewal Licenses',
     If( 
     !IsBlank(SelectedType) || //needs OR here 
     SelectedType = "Contracts",
     LicenseType.Value = "Contracts"
     ,
     SelectedType = "Insurance Policy",
     LicenseType.Value = "Insurance Policy"
     ,
     SelectedType = "License Renewal",
     LicenseType.Value = "License Renewal"
     )
     ),
     SearchItemInput.Text,
     "Title"
     ),
     Ascending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Kentgladwin99 Profile Picture
    40 on at

    Hi @WarrenBelz ,

     

    Thank you for the response. The issue actually has been resolved. But the items in the Gallery still empty. 

    ThisItem.Title = This formula uses scope, which is not presently support for evaluation. (The message still remain).

    Note: Other ThisItem.Column Variable also showing the above message. 

  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Kentgladwin99 ,

    Let me know if you want further input, just note I have not explored the validity of your data as I cannot see it. As mentioned before,I was simply providing a structure for you to work with.

    The code supplied should produce items in the gallery if LicenceType (I assume a dropdown) is

    1. Contracts or
    2. Insurance Policy or 
    3. License Renewal or
    4. Blank

    AND one of the first three is the value of SelectedType (I assume this is a field in 'Renewal Licences')

    AND Title is searchable text

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Kentgladwin99 Profile Picture
    40 on at

    Hi @WarrenBelz ,

    You are completely correct. As I haven't build my "AddNewItemScreen" yet, only a DashBoard Page for now. Will it causes any issue of display item on Gallery. For my understanding it doesn't. 

    No any further input. Thank you. 

     

    Kent

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Kentgladwin99 ,

    Do you want to display Title and LicenseType in your gallery?
    Firstly, please set your gallery's Items:

    SortByColumns(
     Search(
     Filter(
     'Renewal Licenses',
     If(IsBlank(SelectedType),
     true,
     If(
     SelectedType = "Contracts",
     LicenseType.Value = "Contracts",
     SelectedType = "Insurance Policy",
     LicenseType.Value = "Insurance Policy",
     SelectedType = "License Renewal",
     LicenseType.Value = "License Renewal"
     )
     
     )
     ),
     SearchItemInput.Text,
     "Title"),
     Ascending
    )

    // you need to use if statement like this:

    If(condition1,result1,condition2,result2,condition3,result4,condition5,result5)

    While in your original formula, you are lack of condition5, "true" is just result5.

    Also, the opposite of IsBlank() is !IsBlank and !Blank() includes these four conditions: "Contracts","Insurance Policy","License Renewal"  "License Renewal".

    So you need to use formula like this:

    If( IsBlank(..),true //IsBlank(..)is condition5, true is result5
     If(condition1,result1,
     condition2,result2,
     condition3,result3,
     condition4,result4)
     )

    Secondly, if you want to display Title and LicenseType in your gallery, you need to insert two labels in your gallery.

    Step1:

    click the  pen icon on the left top of your gallery

    310.PNG

     

    Step2: insert label1

    Step3: click the  pen icon on the left top of your gallery like step1

    Step4: insert label2

    Step5: set label1's Text: 

    ThisItem.Title

    set label2's Text: 

    ThisItem.LicenseType.Value

    Then the gallery will display these two fields.

    310.gif

     

     

     

    Best regards,

  • Kentgladwin99 Profile Picture
    40 on at

    Hi @v-yutliu-msft ,

     

    Thank you for demonstrating me the instructions and steps of how to do so. However, the Gallery still remain the same not displaying any items. 


  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Kentgladwin99 ,

    Firstly, please check whether the filter formula that I mentioned worked.

    Please save the filtered data in a collection.
    Insert a button, set its button's OnSelect:

    Set(collection,SortByColumns(
     Search(
     Filter(
     'Renewal Licenses',
     If(IsBlank(SelectedType),
     true,
     If(
     SelectedType = "Contracts",
     LicenseType.Value = "Contracts",
     SelectedType = "Insurance Policy",
     LicenseType.Value = "Insurance Policy",
     SelectedType = "License Renewal",
     LicenseType.Value = "License Renewal"
     )
     
     )
     ),
     SearchItemInput.Text,
     "Title"),
     Ascending
    ))

    Please click the button that you use to filter, then click the create collection button.

    Then go to the collection page check your collection whether has data.

    If it has no data, then it means that your filter formula has problem.

    If it has data, then it means that the problem should be about delegation or the gallery's setting.

    1)delegation problem.

    Could you tell me what your data source is and how many records in your data source?

    If your record is more than delegation limit, you may get wrong filter result. This may be the reason why your gallery has no item.

     

    2)gallery's setting.

    After you put the filter formula in the gallery's Items, you also need to choose fields to display in the gallery, just as the gif that I showed.

    3135.PNG

     

     

    Please check these points, which could help me know where your problem is.

     

     

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard