SharePoint calculated column using part of URL

rt96 1 Reputation point
2020-08-03T13:44:35.337+00:00

Hi guys

I am trying to do something new.

I would like to create a calculated column that contains part of current URL by default. So for example;

https://tenant.sharepoint.com/sites/pwa/Project%20Detail%20Pages/Benefits%20SP.aspx?ProjUid=6b2dad8e-71d5-ea11-b08e-00155d0c8600&ret=0

The URL contains ProjUid. I would like to get this value into a SharePoint list column (text is fine) for new items. Any ideas how?!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,615 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,016 Reputation points
    2020-08-04T03:16:55.717+00:00

    SharePoint caculated columns can only reference other columns in the same row, it's impossible to reference the value in current URL. You could check this article for calculated columns: examples-of-common-formulas-in-sharepoint-lists


  2. MichaelHan-MSFT 18,016 Reputation points
    2020-08-05T02:53:49.327+00:00

    Hi, @rt96

    You can use rest api in the workflow to get the ProjectUID. The steps are in this article: project-web-app-get-project-id-from-project-related-site-via-rest

    0 comments No comments