web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search Keywords in Doc...
Power Apps
Unanswered

Search Keywords in Documents in SharePoint

(1) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • Nandit Profile Picture
    1,568 Moderator on at
     
    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
     
     
  • CU17101829-0 Profile Picture
    6 on at
    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:

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard