Upload File Sharepoint Online - How to Check in Document

I am using microsoft office 365 activities pack to upload a file to a sharepoint site. The activity to upload the file completes successfully, but it’s not visible on the sharepoint site. It appears I need to check in the file before it will be visible on the sharepoint site. Does anyone know of a way to do that using the activites? I am using interactive token as my authentication type. I see how to check in the file using the microsoft graph api, but I am not able to retrieve the proper type of token to utilize the API in combination with an http request from UiPath

Hi @ktwil5109

That should not be the case. May be the relative path you have given might be different and the file might have been uploaded to someother place.

this is how you have to use the sp

If sp url is https://www.Sharepoint.com/sites/name/“DocumentLIbrary”/etc

url - https://www.Sharepoint.com/sites/name
drive/library - “DocumentLIbrary”(this might be different as well can check in the site contents as well)
relative path - this will be from the folder after the Document library till the final folder and make sure the slashes should not be there at both the ends

cheers

This doesn’t appear to be the issue. The file that I uploaded to the site that is not visible, if I perform a find files and folders activity, I find the file, and if I compare the DriveItem properties to a file on the site that I can see, the Parent reference path is exactly the same for both files, Path=“/drives/b!TDuCWHmBNUSyiGE5rOwlp1_rcPHpishOgrPi4wyI9h6vvP2FWJBaSprItu9wbmJ9/root:/Cherwell Extracts”

Do you have to use O365 activities? I have used the SharePoint activities package below, it let’s you check in/out files while downloading/uploading

image

1 Like

I do because because of the interactive token authentication type…I was not able to authenticate successfully using the UiPathTeam.Sharepoint.Activities

Hi @ktwil5109

In the new upload file activities you have a datatatable that you need to provide like the creation date or other meta data of file… mayy be that is the reason you are not able to see because without meta data files might look currupted and sometimes sp auto hides.

Recently we observed this change where the upload fileis creating files with no meta data and we have to provide the meta data.

Try doing it

Cheers

Any Chance you have a screenshot or example of the formatting required for this metadata? The attempts I have made I get errors “Field value” can’t be found
image

Hi @ktwil5109

When you open the sharepoint manually you see some columns right…those are the meta data you can provide… please check all the mandatory columns and provide them

Modified might not be editable…try other fields …check what are missing…you will have columns like createdon or so as well.just get the names use in the table…

CHeck this out

Cheers

I have retrieved the columns and tried in multiple different ways to add the data to the datatable variable, and I keep getting metadata errors. If I upload the file without the DT, in the drive item id properties I can get a content.downloadurl and the file is found at that URL. The library I am working in does require you to check in a document when uploading for the first time. There has to be a way with the activities pack to check in the file.

Hi @ktwil5109

I believe checkin will be done only after you checkout but I dont see you doing it. Even though you still have a way …but not using office 365 activities by by directly sending a post request using http request. Please follow the link

Check in a checked out driveItem resource, which makes the version of the document available to others.

I would not say its straight but you can get the item id after uploading pass it to the post request and you would have already had required credentials with you

cheers

Hi @ktwil5109

After looking at it i feel one might be the issue…Are you giving extra inverted commas as I see a single quote and double quote over it again. Can you verify your data may be that is the reason columns are not found

image

cheers

We were able to get this working properly with the Sharepoint Activities pack, we were able to figure out the proper authentication. This pack has the attributes available to check in/check out the file upon upload.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.