Hi @Olaf Weisse ,
We can retrieve URL first, then we need to create a new item of URL. Finally we will redirect to the list.
Here is my code for sample:
//retrieve url
var SubsiteUrl = window.location.href + "";
//create new item
$.ajax
({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Js List')/items",
type: "POST",
headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
data: JSON.stringify
({
__metadata:
{
type: "SP.Data.Js_x0020_ListListItem"
},
Title: SubsiteUrl
}),
success: function (data, status, xhr) {
//redirect to list
window.location.replace("list url");
},
error: function (xhr, status, error) {
}
});
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.