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 / Searching with Graph API
Power Apps
Unanswered

Searching with Graph API

(3) ShareShare
ReportReport
Posted on by 10
Hi
I'm trying to use the Graph API to do search on my Document Library to avoid delegation warnings.
What I'm trying to do initially is to be able to user Graph Explorer to be able to do the proper filtering and after that I will use this via PowerApp.
My document library is called TransmittalAttachments. In this document library, I've added extra columns (document metadata). Those extra columns are of type lookup value (linked to SP List).
 
What I want to do is to be able to search this document library using the name or title (which is working fine) and also search based on the additional metadata columns that I created.
 
 
This is the request body that I used and is working fine when I'm doing the search based on title:
{
  "requests": [
    {
      "entityTypes": [
        "driveItem"
      ],
      "query": {
        "queryString": "(name:Hive OR Title:Hive) AND path:\"https://MY SHAREPOINT SITE/TransmittalAttachments\""
      },
      "from": 0,
      "size": 25
    }
This returns to me only the item(s) that has this keyword in the Name or Title.
 
When I try to do the same searching for specific value for a lookup fields (called OrgCode) using this bod request:
{
  "requests": [
    {
      "entityTypes": [
        "driveItem"
      ],
      "query": {
        "queryString": "(OrgCode:SRG) AND path:\"https://MY SHAREPOINT SITE/TransmittalAttachments\""
      },
      "from": 0,
      "size": 25
    }
I get 0 results.
 
I tried columns with other data types such as text, same thing, I get 0 results. So, I don't think it's related with the data type. I think it's to do with the column.
 
So, why I'm not getting any results?
I have the same question (0)
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    Search File Content in Power Apps from SharePoint Document Libraries utilizing the combined powers of Power Automate and the SharePoint Search REST API endpoint.
     
  • Suggested answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    When you send query against a lookup field, consider using expand on that field.
    Below is as your reference:
     
    GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items
    ?$expand=fields
    &$filter=fields/OrgCodeLookupId eq 'SRG'
    If you get warning that says 'HonorNonIndexedQueriesWarningMayFailRandomly', then 
    add this HTTP header to your Graph request:
     
    Prefer: HonorNonIndexedQueriesWarningMayFailRandomly
     
    good luck.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard