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 Automate / SharePoint Search REST...
Power Automate
Unanswered

SharePoint Search REST API JSON to CSV

(0) ShareShare
ReportReport
Posted on by 10

I am using the SharePoint REST API to return information an all SharePoint sites in a site collection including subsites.

 

Using "Send HTTP Request to SharePoint" connector I do a GET request for

 

_api/search/query?querytext='(Contentclass:STS_WEb)'&trimduplicates=false&rowlimit=5000&Selectproperties='title,url'

 

 Next I use the "Parse JSON" connector autogenerating the schema from the output of the HTTP request.

 

Finally I use the "Create CSV Table" connector. Which results in the error "The 'from' property value in the 'table' action inputs is type 'Null'. The value must be of type 'Array'.

 

My guess is the issue is the JSON is not being parsed correctly. The input and the output essentially look the same not formatted at all.

 

Any help would be appreciated!

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,194 Most Valuable Professional on at

    Hi @Matt01,

     

    The returned json of this method is pretty complex and has a couple of nested arrays. I have tested with it before and as far as I know fields like title and url are store in the property key. So, you would have to transpose this type of data.

     

    I would start with the first array (the results) and work you way down from there:

     

    body('Send_an_HTTP_request_to_SharePoint')['d']['query']['PrimaryQueryResult']['RelevantResults']['Table']['Rows']['results']

     

     

    searchapi_sharepoint.PNG

     

     

    structureresponse_searchapi.png

  • Matt01 Profile Picture
    10 on at

    @Expiscornovus  Thank you for the response! This is a big step closer!

     

    The data does not need to be transposed if you ignore column headers.

     

    With the result from what you suggested the next step would be to extract the "Value" output and place each one in a sperate column.

     

    Any suggestions on how to only select value?

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard