Colleagues -
Need a little guidance on the best method/procedure to display a "No Record Found" message after a user conducts a gallery search through a text input string search that did not return a result. Is there a setting on the gallery itself that can display this? Or I do need to add a textlabel "No Record Found" and write an If(Statement) for its Onvisible properties? If that is the case any formula recommendations for that?
This is what is on the items property. I am using Filter() for delegation reasons - as the datasource is a sharepoint list.
Filter(
'DataSourceName',
StartsWith(
'License Plate',
VehicleSearchQuery
) || StartsWith(
'Permit Number',
VehicleSearchQuery
) || StartsWith(
'First Name',
VehicleSearchQuery
) || StartsWith(
'Last Name',
VehicleSearchQuery
)
)
@PowerPete13 - please could you share what you have in the Items property of your Gallery (as text).
Amik That is correct. Maybe there is a better way to achieve this.
@PowerPete13 - if we just focus on what you're trying to do, rather than whatever solutions you have already implemented - as I understand it:
You want to the Gallery to become visible IF a match has been found from a case-insensitive search.
If a match is not found, the "No record found" label overlaid in front of your Gallery becomes visible.
Is that correct?
The no record found portion of this works very well Imran-Ami Khan and is a great solution. But I am really trying to only show the matching search results (not the entire gallery), so the user doesn't accidentally select the wrong record.
From a freshly loaded screen this procedure works but after a search has been conducted and the user clicks the search box cancel icon I implemented - utilizing Set(SearchVariable,""); Reset(PlateSearchInput_1) on its on select property, the entire gallery record shows on screen for some reason.
🤔 I am using Filter() in the items property of the gallery as the datasource is a sharepoint list.
Here is the complete process I am trying to achieve.
1. Gallery is hidden until search is conducted.
2. Gallery only shows search results relevant that are not case sensitive.
3. If search does not produce record, "No record found" text label is displayed.
4. If user selects cancel icon in the search box, text in the search box is cleared and the gallery is hidden once again.
@PowerPete13 - apologies. There is a mistake/a key step missing in my instructions.
1. Create a Container
2. Cut and Paste your Gallery control into that Container
3. Set the Height property of the Gallery control to "Parent.Height", and the Width property of the Gallery control to "Parent.Width".
4. Insert a Label control into the Container. Set the Height property of the Label to Parent.Height and the Width property to Parent.Width.
5. On the Visible property of the Label, enter:
'Your Gallery'.AllItemsCount = 0
6. In the Tree view, position the Label control in above/in front of the Gallery control.
You can set the visiblity of the gallery to : !(TextLabel_NoRecordFound.Visible)
I think you want to hide the gallery until search text is entered in the box, but the text in the search box could still yield no results which means you would display an empty gallery.
Why don't you display the gallery only when there are results?
In the visible property of the gallery:
Self.AllItemsCount > 0
It works, however, I am experiencing displays issues with it as I am using this formula: If(IsBlank(VariableName), false,true) on the Visible Property of the gallery to hide the gallery until text is entered and searched for in the searchbox control connected to the gallery. Any work arounds you can suggest.
@Amik solutions should work.
Or you can change the fill or border color of the text input control to red and then Notify
Fill or Border color Property of the text control:
If(
And(
!IsBlank(Self.Text),
Gallery.AllItemsCount = 0
),
Color.Red,
Color.NormalColor
)
Onchange property of the text control:
If(
And(
!IsBlank(Self.Text),
Gallery.AllItemsCount = 0
),
Notify("No records found from search string: " & Self.Text, NotificationType.Error, 3500)
)
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473