thoughtasylumTOOLBOX Preview Guides Use offline Automate Feedback

Tools › E-learning

Custom Card Link Builder

Build the JavaScript URL for a SuccessFactors Learning custom card that opens the right link in every environment, using the redirector.js script from the ThoughtAsylum blog, so copying production back to test no longer means editing every card. Then test where it goes from each Learning site.

About this tool What it's for, how to use it and an example

What it's for

A SuccessFactors Learning custom card has one link, but production and test usually need different ones, so every copy back from production to test means editing each card. A card can instead run a script from a JavaScript URL. The redirector.js script from the ThoughtAsylum blog looks at which Learning site the card is on and opens the matching link. This builds the JavaScript URL for it.

For example, when a card should open the test requisition system from your test Learning site and the live one from production, list both sites with their links, and the one URL works in both after every refresh.

How to use it

Host the script somewhere your users can reach once logged in, and give its address in Where your redirector.js is (remembered in this browser). Then choose what The card opens:

  • One link: a full address, the same everywhere, or a path in Learning starting /, which opens on whichever Learning site the card is on.
  • A different link on each Learning site: one line per site, its address (mycompany.plateau.com; a leading https:// or a trailing path is dropped) then a space and the link to open there.

Copy the JavaScript URL for the card into the card’s JavaScript URL. The parts are encoded as the script needs, and a comma in a link is written %2C so it doesn’t split the list. Type a Learning site in Test to see where the card would go from there. Copy a link keeps everything.

Example

Choose A different link on each Learning site, set the script’s address to https://storage.example.com/sfsf/scripts/redirector.js, and give these two lines:

dotcorp.plateau.com https://req.example.com/live/req?type=LRN
dotcorp-stage.plateau.com https://req.example.com/test/req?type=LRN

The JavaScript URL is

https://storage.example.com/sfsf/scripts/redirector.js?url=https%3A%2F%2Freq.example.com%2Flive%2Freq%3Ftype%3DLRN%2Chttps%3A%2F%2Freq.example.com%2Ftest%2Freq%3Ftype%3DLRN&host=dotcorp.plateau.com%2Cdotcorp-stage.plateau.com

and testing dotcorp-stage.plateau.com shows “On dotcorp-stage.plateau.com the card opens https://req.example.com/test/req?type=LRN”.

Good to know

This writes links for that script as published; a changed copy may read them differently. On a Learning site that isn’t listed, the script does nothing, so list every environment. The script compares only the site’s name, so it’s written without https://. Whether custom cards accept JavaScript URLs, and how long a URL may be, is up to SuccessFactors; test a card in your test environment before relying on it. Host the script where only your organisation can change it, as it decides where users are sent.

Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.

Saved you a few minutes? Say thanks with a coffee.

Something wrong with this tool, or missing from it? Report a bug or suggest a feature.

↑ ↓ move↵ openesc close