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.
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…”.
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?
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.
You are correct, you’d start with converting string to secure (or another method of getting your PW as a SecureString).
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.
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…
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
In the above sample am using different ways to uploading a file
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.
ContentStream property on the FileCreationInformation class. Disadvantages
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.
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”
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)