cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Powerapps_Dan
Helper I
Helper I

Shoutouts Canvas App - Search Person Screen Filters

Hi all,

 

Currently using the Shoutouts canvas app and looking to filter out disabled users and users with certain text in their display name (admin users) from the search person screen.

 

I've tried adding Not(EndsWith(DisplayName,"TEXT")) and AccountEnabled to the existing code, but it's not working. I'm new to Power Apps, so I'm sure I'm just not adding it in the correct place.

 

Existing code: 

 

If(IsBlank(Trim(SearchInputBox_4.Text)), MyRelevantPeople, Office365Users.SearchUser({searchTerm: SearchInputBox_4.Text, top: 20}))

 

 2021-06-18 14_32_56-Window.png

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Powerapps_Dan ,

 

Please try this formula:

If(IsBlank(Trim(SearchInputBox_4.Text)),MyRelevantPeople,Filter(Office365Users.SearchUser({searchTerm:SearchInputBox_4.Text,top:20}),AccountEnabled= true ,Not(EndsWith(DisplayName,"TEXT"))))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

6 REPLIES 6
v-xiaochen-msft
Community Support
Community Support

Hi @Powerapps_Dan ,

 

Please try this formula:

If(IsBlank(Trim(SearchInputBox_4.Text)),MyRelevantPeople,Filter(Office365Users.SearchUser({searchTerm:SearchInputBox_4.Text,top:20}),AccountEnabled= false ||Not(EndsWith(DisplayName,"TEXT"))))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi @v-xiaochen-msft ,

 

Thank you! The filter on the ends with display name is working, however disabled accounts are still appearing  unfortunately 

v-xiaochen-msft
Community Support
Community Support

Hi @Powerapps_Dan ,

 

Please change false to true in the image.

vxiaochenmsft_0-1623999791842.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

hi @v-xiaochen-msft ,

 

Unfortunately changing from false to true isn't working either, this also stops the displayname filter from working too

v-xiaochen-msft
Community Support
Community Support

Hi @Powerapps_Dan ,

 

Please try this formula:

If(IsBlank(Trim(SearchInputBox_4.Text)),MyRelevantPeople,Filter(Office365Users.SearchUser({searchTerm:SearchInputBox_4.Text,top:20}),AccountEnabled= true ,Not(EndsWith(DisplayName,"TEXT"))))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Powerapps_Dan
Helper I
Helper I

Hi @v-xiaochen-msft ,

 

That works perfect! Thank You!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,621)