Man must search, but finding invalid links in Office 365 content is pain!

Posted by Aaron Christmas on Feb 15, 2017

Keeping SharePoint lists up to date with a couple clicks

Keeping SharePoint list content up-to-date can be a pain. Especially if you have significant content containing links. This script allows you to search SharePoint list content for invalid links, then in do some custom action to resolve the invalid links.

The genesis of this tool was a desire to make it easy for the end user to keep list content up to date. This script and html files are intended to be plug and play. It does have a dependency on jquery for (the minimal) DOM manipulation, used jquery for convenience sake. It is a strait forward program that can be simply installed by dropping the HTML and JS file into a site asset library. At that point an end user can just add the HTML page to an existing page or navigate to it directly. The power of the script is not only its simplicity of use, but also the ability for customization- specifically what is done when an invalid link is found.

Currently the js is tightly coupled with the following html (All is posted to my Git page)

The UI is simple. It consists of 3 buttons, a drop down, and a text box. To get started click “Check Arbitrary List” then enter the name of the list, and press the “Check Arbitrary List” button next to the text box. Upon typing this, I realize how redundant the UI is! Regardless the processing flow is depicted below:

If any invalid links are found they will be printed below the textbox. If you want, the code can then write up an email for each list item that has invalid links in the content (dependency on outlook). For a more involved update/approval process this code could be easily changed to kick off a workflow.

As with all the JS solutions offered on this blog they can just be used. BUT are better if you customize the fit for your need. For example, this was initially written for a closed network where I did not need to deal with any cross-domain issues or unique client proxy issues.