The requirement is that you want to save the short URL of the document uploaded into the document library, using Nintex Workflow in Office 365.
Prerequisite for this article
- SharePoint Online site
- Nintex Workflow Office 365, subscribed to SharePoint Online
The following is my document library. Here, I have added an extra column “Short URL“ which will store the short URL generated for the current document. You can directly share that URL from Nintex Workflow itself.
Just click on “Library Settings >> Nintex Workflow“.
It will open the Nintex Workflow Designer in your browser. Click on “New List workflow“.
Now, search in the Actions “Google URL shortener“ and drag and drop that action to the Workflow canvas.
Now, double click on the action or click on the down arrow and click “Configure“.
It will open up the configuration settings of the “Google URL shortener“ action.
Here are the configuration steps required.
- URL – Select the URL you want to shorten – In this case, the current item URL. So, I have used “Current Item” from workflow context.
- Create a new variable and use that in the shortened URL field.
- Click on “Save“.
Now, we have to save this shortened URL in the current list item. So, go to the Action section and search for “Set Field in Current Item“. Drag and drop the below Google URL shortener action.
Now, double click on the action or click on the down arrow, and click “Configure“.
Click on the field and select “Short URL“.
After selecting the field’s value, input workflow variable ShortURL which we had created earlier in the Value field.
Now, your workflow is completed. Just click on “Publish“ and publish the workflow.
Enter a unique name for the workflow and select “Start when items are created“ and “Start when items are modified“ in “Start option“ and publish.
Once the workflow is published, then go the document library and upload the file. Here, I have uploaded Test Document into document library.
Here, you can see that the shortened URL is saved in the field. If you want to share this short URL, you can use “Send an Email” action provided by Nintex to send this URL as an email.
Note – This approach can be used to generate shortened URLs for documents, list items, or even any URL added manually in the URL input field in “Google URL shortener” action.
Any question or feedback or suggestion, please do comment and let me know.