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 / Filter issue: failed f...
Power Apps
Answered

Filter issue: failed fetching items

(0) ShareShare
ReportReport
Posted on by 782

Hi all. I'm having an issue with a filter I'm trying to do. The formula is below.

 

I've confirmed that UserHRAdmin is false, so I know the last part of the If is running.

 

I know the first ForAll is running because before I added everything else I checked to make sure I was returning two items. One was a blank value. 

 

I know the RemoveIf is working because I created a gallery and set it to the CurrentHRFacilities and I have one value.

 

I know for certain I have a list item in HR Items that has a column named FacilityCode and I know it has the value of 0450, which matches my one record in the gallery after the RemoveIf.

 

I receive this afterwards:

 

2020-09-17 09_49_25-Window.png

 

If(
 UserHRAdmin = true,
 ClearCollect(
 CurrentHRItems,
 LastN(
 'HR Items',
 1000
 )
 ),
 ForAll(
 CurrentUserHRPermissions,
 Collect(
 CurrentHRFacilities,
 FacilityCode
 )
 );
 RemoveIf(CurrentHRFacilities, IsBlank(Value));
 ForAll(
 CurrentHRFacilities, 
 Collect(
 CurrentHRItems, 
 Filter(
 'HR Items', FacilityCode=ThisRecord.FacilityCode
 )
 )
 )
);

 

Categories:
  • Verified answer
    eliz_talent Profile Picture
    98 on at

    In case this fields are of diffenet type (ex. number and string) - try add in filter Text(..)=Text(..)

     

     

  • notj Profile Picture
    782 on at

    @eliz_talent  that worked. Thanks.

     

    I forgot that PowerApps like to do this thing where it automatically assumes your field types instead of taking the field type from the source. It was changing a text field to a number field for my convenience I suppose.

     

    Edit: It actually didn't work. I didn't get an error, but it returned items that were not true and should have been ignored by the filter.

     

    Edit 2: Your solution worked. I had a completely different issue causing me to return items I shouldn't see. 

     

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard