Forum Discussion

regchecker's avatar
regchecker
Community Member
1 month ago

Storyline 360: JavaScript trigger timeout when fetching vehicle specs from regchecker API

Hello Articulate E-Learning Community,

We are currently developing an interactive driver compliance module in Articulate Storyline 360 for a UK transport organization.

Inside the interactive course, learners enter a UK vehicle registration plate. A custom JavaScript trigger then sends an asynchronous HTTP GET request to an external UK vehicle verification engine (regchecker.co.uk) to dynamically populate course variables (such as MOT status, fuel type, and engine size) on the slide screen.

System Architecture and Course Setup:

  • Data Source Endpoint: (regchecker.co.uk)
  • Mechanism: Storyline Execute JavaScript Trigger -> Fetch API (HTTP GET) -> Parse JSON payload -> Update Storyline text variables (GetPlayer().SetVar()).
  • Software Version: Articulate Storyline 360 (Latest Build).

Technical Issue and Query:

  1. JavaScript Trigger Execution Lag: When running the course inside LMS SCORM packages, the fetch() call to regchecker.co.uk intermittently takes over 3000ms to update Storyline variables, causing slide elements to display blank text.
  2. Web Object CORS Isolation: When embedding the lookup tool directly as a Storyline Web Object, Chrome cross-origin security policies block the iframe response from updating parent slide triggers.

Troubleshooting Steps Taken:

  • Confirmed that backend query speeds on regchecker.co.uk complete in under 200ms when executed directly in desktop browsers outside LMS containers.
  • Added async/await wrapper logic in the Storyline JavaScript trigger code block.

Has anyone experienced execution delays or CORS isolation issues when invoking external REST API queries via JavaScript triggers inside Storyline 360? Any recommended patterns for handling async API variables in LMS environments?

Thanks in advance!

1 Reply

  • ronald-hicks's avatar
    ronald-hicks
    Community Member

    Welcome! I've hit the async-in-Storyline wall before. A few patterns that have helped me:

     

    1. Give fetch() a timeout — it has none by default, and inside an LMS wrapper a slow promise can hang far longer than in a plain browser tab. Wrap it with an AbortController (I use ~10 seconds) so you always get data or a clean failure you can act on.

     

    2. Skip the Web Object for the API call. Run fetch() from a slide-level JS trigger instead — that sidesteps the iframe CORS wall entirely, and you can SetVar() the results directly when the promise resolves.

     

    3. Design for the wait. Set your slide text to "Checking…" before the fetch, and handle both success and error paths in the same chain. Learners staring at blank fields assume the course is broken.

     

    Also worth ruling out: if the endpoint is 200ms in a plain browser but 3000ms+ inside SCORM, check whether the LMS is routing requests through a different egress or proxy. I've chased latency that looked like a code problem and turned out to be infrastructure.

     

    And cache plate lookups in a Storyline variable for the session — most learners revisit slides, and re-fetching the same plate each time adds up.