cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhollan
Level: Powered On

Gallery is blank

I have tried to create an app from a datasource (SP list). However, app doesn't show any records in the gallery.  The formula in the gallery items property is SortByColumns(Filter([@'Project Initiation'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)) .  However, when the search field is blank, the gallery doesn't return any items. Thoughts?

8 REPLIES 8
Super User
Super User

Re: Gallery is blank

@ahhollan 

When the text input ISBLANK a condition of True will show all records.  Make this small change to your code.  

 

 

 

SortByColumns(
    Filter(
        [@'Project Initiation'],
        If(IsBlank(TextSearchBox1.Text),True,StartsWith(Title, TextSearchBox1.Text))
    ),
    "Title",
    If(SortDescending1, Descending, Ascending)
)

 

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

DisappointmentB
Level: Powered On

Re: Gallery is blank

Hello,

 

The formula is expecting a result to be in the search box. You can check to see if the search text is blank. If it is then simply return all the results and if not use the formula you have.

 

Regards

 

Ben

ahhollan
Level: Powered On

Re: Gallery is blank

I made the change and still get errors.

 

11-14-2019 10-09-18 AM.png

 

 

 
DisappointmentB
Level: Powered On

Re: Gallery is blank

Hi,

 

I would separate the formula out so that it is easier to read and see the errors. So:

 

If(IsBlank(TextInput1.Text),

SortByColumns([@'Project Initiation'],"Title", If(SortDescending1, Descending, Ascending)) ,

SortByColumns(Filter([@'Project Initiation'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)))

 

 

Super User
Super User

Re: Gallery is blank

@ahhollan 

It would be helpful to know what error messages you are receiving.

Highlighted
ahhollan
Level: Powered On

Re: Gallery is blank

11-14-2019 10-48-45 AM.png

 

That helped, but now I get...

 

 
 
DisappointmentB
Level: Powered On

Re: Gallery is blank

Hello,

 

Someone with the same problem of the Lookups asked here and a solution has been given. Would be worth checking if you have the same situation.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Error-The-query-cannot-be-completed...

Super User
Super User

Re: Gallery is blank

@DisappointmentB 

Agreed this is a SharePoint issue.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,210)