Karsten Held, Samuel Gross, 20.01.2022
https://[TENANT].sharepoint.com/sites/[SITE]/SitePages/[PAGE].aspx
https://whizzyapps.sharepoint.com/sites/test/SitePages/test.aspx
https://[TENANT].sharepoint.com/sites/[SITE]/SitePages/[PAGE].aspx?$id=[ID]
https://whizzyapps.sharepoint.com/sites/test/SitePages/test.aspx?$id=123abc
In URL shortener mode, you have two features: Shorten a new URL and find an existing URL in the database.
Feature 1: Shorten a URL
Feature 2: Find an existing URL
In redirector mode, you have the third feature: The URL with an Id is the shortened URL, which will redirect to the original URL stored in the database.
Feature 3: Redirecting a shortened URL
The web part will shorten a URL of your choice. You enter the long URL and recieve the shortened URL, which is the URL of the web part page with an Id at the end.
Option 1: Shorten a URL with a generated Id
1. Enter a URL in the "Input URL" text box.
2. Click "Shorten and add to list".
3. Find the shortened URL in the "Output URL" text box.
Option 2: Shorten a URL with specific Id
1. Enter a URL in the "Input URL" text box.
2. Enter an Id in the text box "I have an Id".
3. Click "Shorten and add to list".
4. Find the shortened URL in the "Output URL" text box.
The second feature in URL shortener mode is to find an existing Id in the database.
1. Enter an Id in the "Input Id" text box.
2. Click "Find URL".
3. Find the shortened URL in the "Output URL" text box.
If you open the URL of the web part with an Id at the end, the web part will recognize the Id in the URL and start in redirector mode. It will search for the Id in the database and open the associated target URL automatically. This procedure is called redirecting a URL.
Open the URL of the web part with Id (=shortened URL)
The web part redirects to the target URL. Depending on the loading time of the sites, the web part will appear shortly as:
To configure the webpart, edit page, then edit web part. The web part “property pane” will blend in on the right.
About the web part
Note: You need to be site owner or site admin to be able to configure the web part, otherwise the options will be disabled.
Create new URL lookup list
The database used by the web part is a SharePoint list, that stores the Ids of the shortened URLs and the target URLs.
You can create such a list:
When you deploy the web part the first time, you need to create a lookup list.
You can have multiple lists, for example if you want to deploy the web part on multiple pages on the site collection.
Select URL lookup list
In the dropdown menu will be displayed all user created lists from the site collection.
By clicking “Check list” it will be verified if the list contains the necesary columns with the names “Title”, “Key”, “TargetUrl” and if they are of the right type.
Set length of generated Id
If you use the feature of the web part of shortening a URL with the option to generate an Id, the generated Id will initially have the length of 5 digits. You can choose a length between 4 and 16 digits.