Skip to main content

Notifications

Community site session details

Community site session details

Session Id : DkKIPOcdzqHdFpcQwMfpoc
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,662 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started