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 / What is wrong with thi...
Power Apps
Unanswered

What is wrong with this code? Filtering inside an IF statement

(0) ShareShare
ReportReport
Posted on by 32

Hi,

 

I'm not sure what's wrong with this statement.  It creates neither an error nor shows any sharepoint records in the gallery? I put the code inside the Items property of my gallery. 'Search Box'.Text is the text input field and I want to filter only if it's empty (and display the entire sharepoint list if not).  Can someone please help me?

 

If (
    !IsBlank('Search Box'.Text),
Filter(
    DWBExtractMigrationv1162,
    StartsWith(
        "EDG-ID", Value('Search Box'.Text)) ||
    StartsWith(
        "RequestStatus", 'Search Box'.Text
        ) ||
    StartsWith(
        "RequestType", 'Search Box'.Text)||
StartsWith(
    "Title", 'Search Box'.Text)
), DWBExtractMigrationv1162
)
Categories:
I have the same question (0)
  • Nehal3 Profile Picture
    32 on at

    I meant I want to filter it if the text box is not empty and show the entire list if it is empty!

  • Yogesh Murugan Profile Picture
    447 Moderator on at

    Try this code :

    If(
     IsBlank('Search Box'.Text),
     DWBExtractMigrationv1162,
     Filter(
     DWBExtractMigrationv1162,
     StartsWith("EDG-ID", 'Search Box'.Text) ||
     StartsWith("RequestStatus", 'Search Box'.Text) ||
     StartsWith("RequestType", 'Search Box'.Text) ||
     StartsWith("Title", 'Search Box'.Text)
     )
    )
  • Nehal3 Profile Picture
    32 on at

    Hi, it's the same thing with that code too.  No errors but shows a blank gallery

  • Yogesh Murugan Profile Picture
    447 Moderator on at

    Can you send  screen shot and code ?

  • Nehal3 Profile Picture
    32 on at

    Hi, it's attached.

    Capture_App.JPG
  • Yogesh Murugan Profile Picture
    447 Moderator on at

    Try this

    If(
     IsBlank(Trim('Search Box'.Text)),
     DWBExtractMigrationv1162,
     Filter(
     DWBExtractMigrationv1162,
     StartsWith("EDG-ID", 'Search Box'.Text) ||
     StartsWith("RequestStatus", 'Search Box'.Text) ||
     StartsWith("RequestType", 'Search Box'.Text) ||
     StartsWith("Title", 'Search Box'.Text)
     )
    )

    If is not search is not blank is filtered correct

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard