This SharePoint tutorial explains, how to create a URL using a calculated column in SharePoint 2013 list or document library. In the same way, we can also create a URL using a calculated column in SharePoint 2016/Online.
By default when the user clicks on the Title column of a list then it usually opens the view form. But our requirement was to navigate to a different page with some query string parameter.
Generate URL using Calculated column in SharePoint List
For this we have created a calculated column like below:
="<a href='https://www.enjoysharepoint.com?ID="&ID&"'>"&Title&"</a>"
Here it will take the ID as the query string parameter.
And one more thing we should remember here is that we should choose Number in “The data type returned from this formula is:” section. It should look like below:
After this when you see in the view, you will be able to see the hyperlink column.
Another example we can create an email link, when the user clicks on the link it will open the email window and then in the body, it will put the URL.
=CONCATENATE("<DIV align=""left""><a href=""mailto: ?SUBJECT= &BODY=https://www.enjoysharepoint.com?ID=",ID,""">email this post</a></DIV>")
You may like following SharePoint tutorials:
- Color Code SharePoint List Column Value based on Condition using Calculated Column
- Concatenate multiple columns in List using Calculated Column in SharePoint
- SharePoint 2013/2016/Online: Calculated column to get month and year from date
- SharePoint Calculated column to display duration between two dates in Hour-Minute
- How to work with content type column in calculated field in SharePoint 2013 after migrating from Moss 2007?
- Different ways to create auto increment column in SharePoint 2013/2016/Online list
- Display Task List data in a table using SharePoint REST API and filter by status column
- Change Column Order in List Forms (new/edit/display) in SharePoint
This SharePoint tutorial we learned how to generate URL using the Calculated column in SharePoint 2013/2016 List.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com