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 / Comparing string ignor...
Power Apps
Answered

Comparing string ignoring spaces

(0) ShareShare
ReportReport
Posted on by 172
I have a filter function for a collection
Filter(
    testlist,
    DestDistrict = Trim(varcurrentitem.SourceDistrict)
)
 
the problem i have is the DestDistrict has an extra space in between values like 
 
Wes t Virgini A 
 
now the source district has 
West Virginia
 
how do compare these two values ignoring the spaces in-between or leading
I just want to match the characters only. 
WestVirginia= WestVirginia
 
 
I have the same question (0)
  • Verified answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 1 on at
    try  modify your Filter function:
    Filter(
        testlist,
        Substitute(DestDistrict, " ", "") = Substitute(Trim(varcurrentitem.SourceDistrict), " ", "")
    )
     
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    For efficiency you could use a With and something like 
     
    With({_stringToCheck:Substitute(Trim(varcurrentitem.SourceDistrict), " ", "")},
    Filter(
        testlist,
        Substitute(DestDistrict, " ", "") = stringToCheck
    ))
     
    and remember delegation issues may occur depending on the collection size 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard