cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALFRED05
Helper III
Helper III

HTTP REQUEST TO SHAREPOINT-document library

hi, I am trying to Get an excel in a SP document library.

Can you help me on how the Uri should read? or how to get the correct path?

Captura.PNG

7 REPLIES 7
CFernandes
Super User
Super User

Hi @ALFRED05 .

 

The correct URI syntax would be 

 

https://{site_url}/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files('{file_name}')/$value

 

Reference article: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest 

 

In Power Automate.

 

CFernandes_0-1598425714594.png

 

Note: Dest2 is the name the of my document library and 'sample_pin.xls' is the name of by excel file.

 

You can change the above with dynamic values returned by Power Automate trigger(prehaps you can use 'When a file is created properties only').

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

ALFRED05
Helper III
Helper III

Hi @CFernandes , thanks for your help! however it did not work.

 

I got this error first, so I just added what it said and tried again.I got this error first, so I just added what it said and tried again.this is how it lookedthis is how it lookedbut I got this, I am the owner of the SP site and I dont have the excel file locked in any waybut I got this, I am the owner of the SP site and I dont have the excel file locked in any way

 

any idea what could be going wrong?

@ALFRED05 

 

In the URI - please add only 

 

/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files('{file_name}')/$value

 

Please do not add SPWeb.ServerRelative URL. Please create the request similar to the screenshot below.

 

Untitled.png

 

Also please check the the permission for the user(with which you have created the SharePoint connection) on the document library.

 

 

ALFRED05
Helper III
Helper III

@CFernandes 

 

The same error 😞

 

egsfgds.PNGCapturasadfgdsfgsgfd.PNG

@ALFRED05 Can you let me know what are you trying to achieve? Perhaps we can work around it using another approach?

@CFernandes  Sure,

 

I am trying to dump rows from and excel to sharepoint list, dinamically...like when an excel is uploaded to SP, grabs that file and copy the rows to a sharepoint list.

@ALFRED05 You can follow the tutorial at https://www.youtube.com/watch?v=jTLJr4U_Gho

 

Instead of the Recurrence trigger you use 'When a file is created SharePoint' Trigger.

 

I hope it helps.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (784)