When documents are uploaded to document libraries in SharePoint Online, these documents can be accessed directly through a URL which helps to keep track of all changes that are made in these documents. If the workflow is started through a SharePoint list event, i.e. new or update list item, the URL can be easily obtained with the “Item URL” of the Start Variable.
However, if the workflow is not started through a SharePoint list event but a component workflow, the “Item URL” will not be available through the “Retrieve an item” action. To obtain the URL for the document, this is what you need to configure in your workflow actions.
-
Configure a “Retrieve an item” action from SharePoint Online. This will allow you to get the values for the specific document record in the document library. Store the result in a new object.

-
Next, configure a “Create a text string” action to start forming the URL to the document. The syntax of the string should be “https://<SharePointURL>/:w:/r/sites/<SiteName>/<DocumentLibraryName>/{Name}?sf=1&web=1”
Where the following should be replaced with
-
<SharePointURL> = Your SharePoint Online tenant URL.
-
<SiteName> = The site name where the document library is located. This can be easily retrieved from the web address when you are on the landing page of the document library.
-
<DocumentLibraryName> = The name of the document library. This can be easily retrieved from the web address when you are on the landing page of the document library.
-
{Name} = This is the variable obtained from the object created in Step 1.

The output result should provide you with the required URL to the specific document in the document library.