Hi var CurrentUrl = _spPageContextInfo.siteServerRelativeUrl
try to add this line into your page's header and log the variable CurrentUrl. or window.location and parse the query string to get specific parameter
Get current URL and put into SharePoint Online column
Rob Smith
1
Reputation point
As per title really, is there a way to get the current browsed URL and put automatically into SharePoint Online column? This is on the NewItem.aspx page. I need to get the full URL (including a ?ID= bit on the end)
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint | For business | Windows
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
2 answers
Sort by: Most helpful
-
Murugesa Pandian 86 Reputation points2020-09-01T17:22:08.77+00:00 -
Baker Kong-MSFT 3,801 Reputation points2020-09-02T01:28:57.447+00:00 Hi RobSmith-5452,
You can use 'window.location.href' to get the entire URL of the current page.
Check https://www.tutorialrepublic.com/javascript-tutorial/javascript-window-location.php
Thanks
Baker Kong
If the response is helpful, please click "Accept Answer" and upvote it.