SharePoint

Hello Rudravas.
I don’t believe what “I don’t require any username / pwd to access the SP site.” because every microsoft account have login and password, if your site is public why you wrote (http://teams.xxxx.com/), so this url is not full, look example. I can’t testing SP without login and password, I don’t have public SP, maybe you need create credential for your site.

Have a nice day.

I have MFA in my Sharepoint, and my Share point session features error “: Cannot contact web site ‘https…/’ or the web site does not support SharePoint Online credentials. The response status code is ‘Forbidden’. The response headers are 'X-SharePointHealthScore=0…”.

How can I solve this problem?

Hello Leo. This activiti dosn’t working with MFA. You can create new user for bot and disable MFA for bot_user. Have a nice day.

I’m able to successfully upload a text file to my target document library but the output parameter for LinkPath is always null. I’m uploading to SharePoint Online. Any idea why the LinkPath isn’t returned?

Do we have any activity for getting list of the files in a sharepoint folder?

1 Like

Hey Tyler can you share your example? I am having a hell of a time trying to get this thing to work. Can anyone show the full steps? I am assuming we start with Convert string to secure, sharepoint session then, upload?
Thanks,
John

John, I’ll list the steps it is pretty straightforward once I had it figured out.

  1. You are correct, you’d start with converting string to secure (or another method of getting your PW as a SecureString).
  2. You’ll then need to use the “Share point session” activity to initialize a “ClientContext” variable (for the “Upload” activity to use). I entered the url for my site collection as the “UrlPath” value, my email address used to access SP for the “UserName” value, and the secureString variable that was already created as the “UserPassword” value.
  3. Last you’ll use the “Upload” activity. Use the ClientContext variable you created as the “ClientContextSession” value, the name of the document library as the “LibraryName”, the path to the file you wish to upload as the “LocalPath”, and for the “PathToFolder” value I used the relative path of the document library that I named to upload the file to.

Interestingly, I had to go back through and recreate this (I’ve moved on to using the Graph API as I also want to populate metadata in the columns of the item) to answer your question and my LinkPath variable appears to work properly now. Not sure what I did differently this time though…

Hope this helps!

Hi @jboli48867,
You can try the other approach to upload the files to sharepoint using invoke code
with help of the Assembly microsoft.sharepoint.client

check the sample for further deep dive
Upload_share_point (2).zip (3.0 KB)

In the above sample am using different ways to uploading a file

  1. SaveBinaryDirect method on the Microsoft.SharePoint.Client.File class
    benefits
  • No file size limits. Time-out occurs after 30 minutes.
  • Only use this method if you’re using a user-only authentication policy. A user-only authentication policy is not available in a SharePoint Add-in, but can be used in native device add-ins, Windows PowerShell, and Windows console applications.
  1. ContentStream property on the FileCreationInformation class.
    Disadvantages
  • file size limits.Upto 256 Mb
  • Recommended for,SharePoint,ServerSharePoint Online
  1. Content property on the FileCreationInformation class.
    Disadvantages
    Maximum file size that can be uploaded is 2 MB. Time-out occurs after 30 minutes.

Get the list of Files and Folder names from Share_point

Get List_of_files_and_folder_name_from_sharepoint.zip (2.8 KB)

Dependencies

  1. Microsoft.sharepoint.client.dll
  2. Microsoft.sharepoint.client.runtime.dll

Regards
Sanjay Shankhla

I am trying to use sharepoint activity to download files.
Sharepoint session activity give me error “The ‘username’ argument is invalid”
user name is a string variable. I am not sure what is wrong with it.

@Gowtham_M does you workflow run with no issues if you type in the user between quotation marks? (hard coded value)

image

Looks like i need to give @domainname.com along with username.
now i am getting another error which says “IDCRL response header from server is not valid”

Hi , I have a issue in connecting sharepoint session …value doesnot fall in expected range

Did you ever find a solution to this error?
@Gowtham_M

I’m getting an error saying the remote server not found. However, the ‘Upload File’ activity successfuly uploads a file to the desired location. My objective to get a specific file from a SP folder.

RemoteException wrapping System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at UiPathTeam.SharePoint.Utils.GetFileByUrl(ClientContext clientContext, String relativeUrl)
at UiPathTeam.SharePoint.Utils.GetFileFromSharePoint(ClientContext clientContext, String localPath, String relativeUrl)
at UiPathTeam.SharePoint.Activities.Libraries.GetFile.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

UPDATE:

I fixed my problem.

Could you please help me to design the code for Download, Delete and Move File

Great thread! Thanks for the share!

How can I solve this problem?