cancel
Showing results for 
Search instead for 
Did you mean: 

Sharepoint Integration

LuigimariaCerto
Level 3
Morning,
I'm trying to work with a sharepoint list using Sharepoint Doc Utility given with the Sharepoint List Library Skill/Document library Skill. 
I'm trying to test if I can check if a document exists or not in the following list: https://company.sharepoint.com/sites/TestDocument/Test%20Documents/Forms/AllItems.aspx
Inside this list I have a document called "test.txt".
So what I want to to is to move this my from a document library to another.

Using Copy File (Sharepoint Doc Utility) I set all as following:
Domain Entity: "company"
URI: /
Bearer Token Authentication Credential: "Bearer Token"
FileName: "text.txt"
Destination Folder: "/Test%20Documents"
Source Folder: "/Shared%20Documents"

"Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 404
HTTP Response Content: {"error":{"code":"-2130575338, Microsoft.SharePoint.SPException","message":{"lang":"en-EN","value":"The file /Shared Documents/Reporting.xlsx doesn't exists."}}}"

I read the documentation but doesn't give the information I need to help me work this out. Do you know how to let it work?
Thankyou




------------------------------
Luigimaria
------------------------------
7 REPLIES 7

It appears you are working with sharepoint Lists, but using the document library skill. 
"I'm trying to test if I can check if a document exists or not in the following list"

Im going to assume you are working with documents and propose my findings,
Looking at the URL, the path of the file seems to be "TestDocument/Test%20Documents". you might want to correct this.
Im not still sure why the error shows "/Shared Documents/Reporting.xlsx doesn't exists." despite giving the correct file name in the input

To further understand this, can you try the following steps
1. Go to web apis in system.
2. open the api "Blueprism: Sharepoint Doc Utility" . It might show a popup, click "yes" and continue
3. Find the "copy file" action and click on it.
4. There must be 3 check boxes. Find the checkbox that says "Disable sending of Request" and enable it.
5. Also check if the "Enable Request Data Output Parameter" is checked. if not check it as well. 

Once done, run the process again and look at the output value called "Request Data" from the skill and share it here. I can share my thoughts further.
once done, revert the changes.

on the contrary if its a list  that you are working( i doubt this is the case),
then you cannot use document library and a straight copy will not work. 
list items usually carries files as attachments
you will probably have to read the txt file from the list item into a binary data item and them. then run a delete of the attachment in the list item and then add this file back into the destination item

------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------

Hi,

If You need to get attachment from the list item then the You can map Your list as a network drive (at least it works that way for sharepoint online) and then each item with attachment has subfolder named with sharepoint list ID. Then You can just use utility - file management to make neccessary operations.

link to the attachment folder looks like that: https:/company.sharepoint.com/sites/sharepointsite/Lists/Test_List/Attachments/220

------------------------------
Michal Szumski
RPA developer
Rockwell Automation
Europe/Warsaw
------------------------------

Hi,
about your solution @Michal Szumski I could use it and it's probably releable enough to work in this way. The problem is that I need to change the metadata of the document I uplaoded using the Sharepoint List Library but I can't see any update stage to update the metadatas of the document that was uploaded.

@Bimal Sebastian​​ I did as you asked but I cant find the variable you are talking about "Request Data".
Anyway casually I understood what the variable wanted as "URI" and I inserted the value "/sites/TestDocument" than "sites/TestDocument" and I got a different error:

"Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 400
HTTP Response Content: {"error":{"code":"-2147024809, System.ArgumentException","message":{"lang":"en-US","value":"Server relative urls must start with SPWeb.ServerRelativeUrl"}}}"

Thank you for your help guys!

------------------------------
Luigimaria
------------------------------

I want to update about this problem. I still can't figure out why I get this error.
Anyway for now I'm working with file manager and it works but I really need to add metadata do the documents. 
Luigi

------------------------------
Luigimaria
------------------------------

Hi Luigimaria,

I was thinking about Your problem and maybe this is stupid idea but can You try upload file first and then set metadata with OLEDB? You can just treat this folder as a list and update necessary columns with UPDATE command in OLEDB.

Best regards,
Michal Szumski

------------------------------
Michal Szumski
RPA developer
Rockwell Automation
Europe/Warsaw
------------------------------

Hi sorry if I answer you now.
I tried the solution you gave me but for some reason I can't make the connection to the "database" sharepoint. OLEDB requires some versioning management that for company policy we cant manage for now. So we can stick with http call. I used a lot powerautomate (microsoft) and https calls block. The real challenge now is understand how to write data into a list/gallery. 
Luigi



------------------------------
Luigimaria
------------------------------

Hi Bimal,  @Bimal Sebastian

Even I have an issue with downloading a file into local path. 
I am trying to download all the files from a sharepoint folder into local path. 

Get Files actions:
Domain Entity : XXX
URI : teams/Site/SubSite
Bearer Token Authentication Credential Name : CredentialName
FolderPath: /Folder/SubFolder


Copy File action:
Domain Entity : XXX
URI : teams/Site/SubSite
Bearer Token Authentication Credential Name : CredentialName
FileName : xxxxxxxxxxxx.doc
Destination Folder: D:/
Source Folder: /Folder/SubFolder


Get File action is working but not the Copy File. 

I have posted my questions in forum under below links. You can find more info there if needed.
https://community.blueprism.com/communities/community-home/digestviewer/view-question?ContributedContentKey=6973bb7c-dd6e-4e97-9444-fbf44da7c1bd&CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&tab=d...

https://community.blueprism.com/communities/community-home/digestviewer/view-question?ContributedContentKey=99a312f8-168b-4de4-82a5-802f1c16c21c&CommunityKey=1e516cfe-4d1f-4de9-a9eb-58d15bf38c81&tab=d...

https://community.blueprism.com/communities/community-home/digestviewer/view-question?ContributedContentKey=d1e08f81-ac7d-44c2-a7d6-190a88e85be3&CommunityKey=1e516cfe-4d1f-4de9-a9eb-58d15bf38c81&tab=d...

Please provide some insights.

Thanks
Manohar

------------------------------
Manohara M
Senior Project Engineer
Wipro Technologies
Asia/Kolkata
------------------------------