Have any of you ever tried to publish document after uploading it onto SharePoint using O365 package?
We have this scenario wherein once the file is uploaded, it doesn’t become available for view unless specifically published.
Have any of you ever tried to publish document after uploading it onto SharePoint using O365 package?
We have this scenario wherein once the file is uploaded, it doesn’t become available for view unless specifically published.
Well there is no activity..but published in graph api is via a parameter in check in..check below api call
you can use O365 Http request
cheers
In SharePoint Online (O365), some libraries require check-in or publishing before a document is visible to others, especially if the library has content approval or minor/major versioning enabled.
Using UiPath with the O365 Activities package, you can do this as follows:
Sequence example in UiPath:
Hi everyone,
Thanks for your response.
Upon more research, we found that there are 2 ways check-in can be achieved.
Calling check-in endpoint for graph API using http request
Using the check-in property that is available in upload file activity itself. See below
However, both of these approaches didn’t work for us. Upon further digging and discussions with SP team, we learned that as per library settings enabled for this site, explicit check-out will be needed before check-in can be attempted.
So, we had to do follow below approach:
Upload file
Fetch Id of uploaded file and its site Id
Get access token for graph API
Hit check-out endpoint for graph API: https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/checkout
if checkout is successful, then hit check-in endpoint: 4) Hit check-out endpoint for graph API: https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/checkin
with json as below, In our case, checkInAs as published turned out to be mandatory as without it, document was not getting checked in. But it can also work without this property is some case, depends on library settings:

Hope this helps.
Regards
Sonali
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.