Submit your inspiring success story or innovative use case to the 2022 Dataiku Frontrunner Awards! ENTER YOUR SUBMISSION

Sharepoint Plugin - Server relative urls must start with SPWeb.ServerRelativeUrl

Solved!
akmalh_09
Level 2
Sharepoint Plugin - Server relative urls must start with SPWeb.ServerRelativeUrl

Hi Experts,

I encountered this error message when trying to write back the results to SharePoint document library

Failed to write data : <class 'sharepoint_client.SharePointClientError'> : Error: Server relative urls must start with SPWeb.ServerRelativeUrl

I think the plugin is configured correctly as I can see the files and folders in my SharePoint document library and I can even read the data from it. It is just when I want to write back, it prompted this error message.

I used "Export to folder" recipe and linked it with the SharePoint plugin. In the SharePoint plugin, for the Path, I browsed to my intended Sharepoint document folder.

May I know where I need to fix?


Operating system used: Windows 10

0 Kudos
1 Solution
AlexB
Dataiker
Dataiker

Hi @akmalh_09 

This is probably the reason why the writing operation is failing. To find out what the preset settings should be, you can use your web browser, log into your SharePoint and navigate to the target directory. Once reach it, the browser should have a URL in the top box looking like this:

sp_url.png

 In your preset, your should have

  • the content of "3" in the "Root directory" box. 3 is the segment of the URL between /Forms and the previous /
  • the content of "2" in the "Site path" box. 2 is the whole segment between 3 and the sharepoint.com/ section of the URL. It can contain one or more /

 

 

View solution in original post

0 Kudos
4 Replies
AlexB
Dataiker
Dataiker

Hi !

In your site app preset, is there something in the "Root directory" box ?

0 Kudos
akmalh_09
Level 2
Author

Hi @AlexB 

No. The root directory is blank.

0 Kudos
AlexB
Dataiker
Dataiker

Hi @akmalh_09 

This is probably the reason why the writing operation is failing. To find out what the preset settings should be, you can use your web browser, log into your SharePoint and navigate to the target directory. Once reach it, the browser should have a URL in the top box looking like this:

sp_url.png

 In your preset, your should have

  • the content of "3" in the "Root directory" box. 3 is the segment of the URL between /Forms and the previous /
  • the content of "2" in the "Site path" box. 2 is the whole segment between 3 and the sharepoint.com/ section of the URL. It can contain one or more /

 

 

0 Kudos
akmalh_09
Level 2
Author

Hi @AlexB 

This works like a charm! Thanks a lot!

0 Kudos