cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
clewis
Regular Visitor

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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.

@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
Community Champion
Community Champion

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

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,178)