Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

SharePoint.Files with "Shared%20Documents" MS Teams folder

I'm trying to access a folder on our MS Teams sharead documents. 

 

Base URL access works - no issues.

https:/company.sharepoint.com/teams/team_12345678/

 

However if I only try to get one level deeper to avoid getting toons of files - I get "404 not found" errors. And yes I checked that this folder exists

https://company.sharepoint.com/teams/team_12345678/Shared Documents/General/

 

It does not matter if I try:
= SharePoint.Files("https://company.sharepoint.com/teams/team_12345678/Shared Documents/General/", [ApiVersion = 15])

or

= SharePoint.Files("https://company.sharepoint.com/teams/team_12345678/Shared%20Documents/General/", [ApiVersion = 15])

 

~~~

I read all the search results about ApiVersion, and folder names should have no spaces. However this is a standard folder that I can't change.

 

Any suggestions?

  • That's how it works. You must specify the base URL only. After that use Power Query to narrow down which files you want to access.

     

    Technically you could use a web connector, but that is bad for a variety of reasons.  Stick with the Sharepoint.Files connector and use it as intended.

4 Replies

  • That's how it works. You must specify the base URL only. After that use Power Query to narrow down which files you want to access.

     

    Technically you could use a web connector, but that is bad for a variety of reasons.  Stick with the Sharepoint.Files connector and use it as intended.

  • Anonymous's avatar
    Anonymous
    Not applicable

    It is not the solution I prefer as it will always query far to many files - however it works. The filters of the FilePath are you best friends, and you need to make sure to have good folder structure to ensure correct files being found.

    I would be much easier if this connector would alow a more detailed folder as a reference.

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      I would like to respectfully disagree.  The flexibility of the connector allows you to specify whatever search terms you want (based on file name, based on folder name, based on pattern etc), and it also allows you to combine files that may be located in different folders (for example).

      • Anonymous's avatar
        Anonymous
        Not applicable

        Yea - may be it is then a problem how we structure our Sharepoint's. The system work and yes you can do a lot with the filters. 

        As a programmer I like to have the API be specified more specificly with having a clear location target. Not a broad "folder" and then just search apply.

        E.g. if someone would do the access rights wrong, I could create a security risk by having all of a sudden a file which the service should not see. Having more specific folders I can limit this from the beginning.

        However as you say - it is kind of a "indivudal/cultural" way of solving it.