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

Search defaulting to 0 records?

Ahoy there fellow Powerapp Wizards, 

 

I have a pretty simple app that connects to CRM using Office 365. The intent is to display all the contacts for a specified user. Doing this, I have the Office365 connection with myprofile grabbing the UserPrincipalName and then tieing it with CRM's User table ontop of the internalemailaddress (this is something I am miffed about, but this is not the issue at hand). 

 

The gallery's items are filtered out on the system user id and there is a search box that further refines the contact gallery: 

SortByColumns(Search(Filter(Contacts_1, _ownerid_value = labelSystemUser.Text), searchText.Text, "new_companyname", "firstname"),"fullname", Ascending)

 

This doesn't appear to work upon when the app first is visible or starts, but as soon as I type text into the searchText box I get results..and if i clear out all text I wrote, I get the full list of contacts. 


What am I doing wrong and how can I fix this? 

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: Search defaulting to 0 records?

Hi @clewis

I now cannot find my post either, or maybe I intended to post and never actually did.

Basically in one of my apps I had exactly your issue, something needs to be entered and then deleted in the search input box before any records are shown at all.

One work-around you can use is to set the Items property of the gallery to something like the following:

SortByColumns(
If(
!IsBlank(searchText.Text),
Search(Filter(Contacts_1, _ownerid_value = labelSystemUser.Text), searchText.Text, "new_companyname", "firstname"),
Filter(Contacts_1, _ownerid_value = labelSystemUser.Text)
),
"fullname", Ascending)

 

View solution in original post

4 REPLIES 4
Meneghino
Level 10

Re: Search defaulting to 0 records?

Hi @clewis

This is a bug that I have noticed in the past and have posted about.

You could try to write to Microsoft support to get it fixed.

@v-micsh-msftmay be able to provide some insight.

Thank you.

clewis
Level: Powered On

Re: Search defaulting to 0 records?

@Meneghino, after googling for a little bit I can't seem to find what you've previously posted about. Can you point me in the right direction? I'd love to understand this bug a bit better so I can find a work around. 

Meneghino
Level 10

Re: Search defaulting to 0 records?

Hi @clewis

I now cannot find my post either, or maybe I intended to post and never actually did.

Basically in one of my apps I had exactly your issue, something needs to be entered and then deleted in the search input box before any records are shown at all.

One work-around you can use is to set the Items property of the gallery to something like the following:

SortByColumns(
If(
!IsBlank(searchText.Text),
Search(Filter(Contacts_1, _ownerid_value = labelSystemUser.Text), searchText.Text, "new_companyname", "firstname"),
Filter(Contacts_1, _ownerid_value = labelSystemUser.Text)
),
"fullname", Ascending)

 

View solution in original post

clewis
Level: Powered On

Re: Search defaulting to 0 records?

Boy howdy @Meneghino, that really worked well. Thank you kindly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 334 members 5,181 guests
Please welcome our newest community members: