Skip to main content

Notifications

Community site session details

Community site session details

Session Id : +/fU2cqY9I4WyC2gx9yaxp
Power Apps - Building Power Apps
Unanswered

Search Keywords in Documents in SharePoint

Like (1) ShareShare
ReportReport
Posted on 25 Oct 2024 15:01:32 by 6
Hi, I am currently creating a power app to search policy documents in SharePoint. I am able to search the documents name using the below code:
If(
    (IsBlank(Dropdown3.Selected.Value)),
    Search(
        Filter(
            Documents,
            !IsFolder
        ),
        TextInput2_1.Text,
        Name,
        'Link to item',
        Title
    ),
    With(
        {
            _Data: Filter(
                Documents,
                'Type of Policy'.Value = Dropdown3.Selected.Value
            )
        },
        Search(
            Filter(
                _Data,
                !IsFolder
            ),
            TextInput2_1.Text,
            Name,
            'Link to item',
            Title
        )
    )
)
 
To search through the documents for keywords, I have to create a power automation flow. The flow works correctly alone in a gallery when I put
Table(ParseJSON(varSearchResults.searchresults))
 
 
I want to add the above line to my if statement so it can search the document name and for keywords but when I add it to my filter line, it does not look for keywords. It still only search the name. The code I am trying to use is below:
If(
    (IsBlank(Dropdown3.Selected.Value)),
    Search(
        Filter(
            Documents,
            !IsFolder, ParseJSON(varSearchResults.searchresults)
        ),
        TextInput2_1.Text,
        Name,
        'Link to item',
        Title
    ),
    With(
        {
            _Data: Filter(
                Documents,
                'Type of Policy'.Value = Dropdown3.Selected.Value
            )
        },
        Search(
            Filter(
                _Data,
                !IsFolder,ParseJSON(varSearchResults.searchresults)
            ),
            TextInput2_1.Text,
            Name,
            'Link to item',
            Title
        )
    )
)
Categories:
  • CU17101829-0 Profile Picture
    6 on 28 Oct 2024 at 00:43:01
    Search Keywords in Documents in SharePoint
    Hi Nandit
     
    varSearchResults.searchresults Searching keywords in each document on Sharepoint. I’ll type a word in a text box in power apps and the Gallery or table will display results that have that word you searched for. It works when i run the flow on its own but not when i try to display results in a table and put it in an if statement. 

    Here is a screenshot of the flow:

  • Nandit Profile Picture
    1,563 Super User 2025 Season 1 on 28 Oct 2024 at 00:15:25
    Search Keywords in Documents in SharePoint
     
    What's the output of your Power Automate flow? What's in varSearchResults.searchresults? Does it contain names of the Documents which have your Search text?
     
    Kind regards, 
    Nandit
     
     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 205 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 108

#3
stampcoin Profile Picture

stampcoin 80

Overall leaderboard
Loading started