cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Kudo Kingpin
Kudo Kingpin

How Do I get the Download link from a search Query

Hi 

 

I am sending  http request to the SharePoint Search api. (_api/search/query/Template= ........)

 

How do I get the DownloadUrl  as a return from the http request.

 

Thanks

 

Nigel

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @NigelP 

 

Yes that's what I was thinking. All you need is add a Parse JSON step and extract the values.

 

If your problem has solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

9 REPLIES 9
abm
Super User
Super User

Hi @NigelP 

 

Could you please post an example of your http output data?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
NigelP
Kudo Kingpin
Kudo Kingpin

 

Hi @abm 

 

Here is the http request :-

 

httprequesttosharepoint.JPG

 

REgards

 

Nigel

abm
Super User
Super User

Hi @NigelP 

 

Thanks for the reply and screenshot.

 

I asked for the run history of the http request. Is that contains the download url?



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
NigelP
Kudo Kingpin
Kudo Kingpin

Hi @abm 

 

I am assuming I need to add something to properties in the api call.

 

REgards

 

Nigel

Hi @abm 

Here is the json rom the http request :-

 

{
  "odata.metadata""https://<tenant>.sharepoint.com/_api/$metadata#Microsoft.Office.Server.Search.REST.SearchResult",
  "ElapsedTime"40,
  "PrimaryQueryResult": {
    "CustomResults": [],
    "QueryId""ac3e912d-79f3-4013-a4b7-4a385c3ee455",
    "QueryRuleId""00000000-0000-0000-0000-000000000000",
    "RefinementResults"null,
    "RelevantResults": {
      "GroupTemplateId"null,
      "ItemTemplateId"null,
      "Properties": [
        {
          "Key""GenerationId",
          "Value""9223372036854775806",
          "ValueType""Edm.Int64"
        },
        {
          "Key""indexSystem",
          "Value""",
          "ValueType""Edm.String"
        },
        {
          "Key""ExecutionTimeMs",
          "Value""16",
          "ValueType""Edm.Int32"
        },
        {
          "Key""QueryModification",
          "Value""Marina IsDocument:true FileExtension<>aspx -ContentClass=urn:content-class:SPSPeople",
          "ValueType""Edm.String"
        },
        {
          "Key""RenderTemplateId",
          "Value""~sitecollection/_catalogs/masterpage/Display Templates/Search/Group_Default.js",
          "ValueType""Edm.String"
        },
        {
          "Key""StartRecord",
          "Value""0",
          "ValueType""Edm.Int32"
        },
        {
          "Key""IsLastBlockInSubstrate",
          "Value""true",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""IsFirstBlockInSubstrate",
          "Value""false",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""IsFirstPinnedResultBlock",
          "Value""false",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""IsLastPinnedResultBlock",
          "Value""false",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""IsFirstRankedResultBlock",
          "Value""true",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""IsLastRankedResultBlock",
          "Value""true",
          "ValueType""Edm.Boolean"
        },
        {
          "Key""MixedTableOrder",
          "Value""0",
          "ValueType""Edm.Int32"
        },
        {
          "Key""GeoLocationSource",
          "Value""GBR",
          "ValueType""Edm.String"
        }
      ],
      "ResultTitle"null,
      "ResultTitleUrl"null,
      "RowCount"10,
      "Table": {
        "Rows": [
          {
            "Cells": [
              {
                "Key""Rank",
                "Value""0",
                "ValueType""Edm.Double"
              },
              {
                "Key""DocId",
                "Value""17600727656670",
                "ValueType""Edm.Int64"
              },
              {
                "Key""Title",
                "Value""Email for Nigel",
                "ValueType""Edm.String"
              },
              {
                "Key""Path",
                "Value""https://<tenant>.sharepoint.com/Marketing Documents/Email for Nigel.docx",
                "ValueType""Edm.String"
              },
              {
                "Key""UIVersionStringOWSTEXT",
                "Value""1.0",
                "ValueType""Edm.String"
              },
              {
                "Key""ParentLink",
                "ValueType""Edm.String"
              },
              {
                "Key""FileExtension",
                "Value""docx",
                "ValueType""Edm.String"
              },
              {
                "Key""SiteId",
                "Value""d31eb6a0-c076-4602-80a5-9c5a8cd4e2d0",
                "ValueType""Edm.String"
              },
              {
                "Key""WebId",
                "Value""d59abf34-6af2-4012-86d6-ea785cd82ad2",
                "ValueType""Edm.String"
              },
              {
                "Key""UniqueId",
                "Value""{3AD00049-9773-4193-9760-58EFE739FEAC}",
                "ValueType""Edm.String"
              },
              {
                "Key""OriginalPath",
                "Value""https://<tenant>.sharepoint.com/Marketing Documents/Email for Nigel.docx",
                "ValueType""Edm.String"
              },
              {
                "Key""PartitionId",
                "Value""051b1a02-1b84-41ef-ba3b-209ba63726fd",
                "ValueType""Edm.Guid"
              },
              {
                "Key""UrlZone",
                "Value""0",
                "ValueType""Edm.Int32"
              },
              {
                "Key""Culture",
                "Value""en-GB",
                "ValueType""Edm.String"
              },
              {
                "Key""ResultTypeId",
                "Value""0",
                "ValueType""Edm.Int32"
              },
              {
                "Key""RenderTemplateId",
                "Value""~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default.js",
                "ValueType""Edm.String"
              },
              {
                "Key""GeoLocationSource",
                "Value""GBR",
                "ValueType""Edm.String"
              }
            ]
          },
          {
            "Cells": [
              {
                "Key""Rank",
                "Value""0",
                "ValueType""Edm.Double"
              },
              {
                "Key""DocId",
                "Value""17597795314655",
                "ValueType""Edm.Int64"
              },
              {
                "Key""Title",
                "Value""NJPEnterprisesInvoice094",
                "ValueType""Edm.String"
              },
              {
   etc etc
 
REgards
 
Nigel

Hi @NigelP 

 

It's my bad I thought you already had this in your result sets and you struggling to get this value from JSON.

 

You already have Title, Path, File extension etc in your http request. Is that enough to construct the ur?

 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @NigelP 

 

Thanks for the JSON results. 

 

Is these are your donwload link? 

https://<tenant>.sharepoint.com/Marketing Documents/Email for Nigel.docx

 

If not please explain a bit more about it.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
NigelP
Kudo Kingpin
Kudo Kingpin

@abm 

 

I see what you mean !

 

Yes I could use that url (OriginalPath) as the download link.

 

Thanks

 

Nigel

Hi @NigelP 

 

Yes that's what I was thinking. All you need is add a Parse JSON step and extract the values.

 

If your problem has solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,123)