Hi everyone,
I'm on OutSystems 11 (Reactive Web) and I need to load a third-party JavaScript library — ExcelJS — into a screen so it's available when the screen loads. I'm building a client-side Excel export, and my JavaScript node uses ExcelJS.Workbook().
Library URL I want to load:
https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.min.js
Hi @Youcef Mammar kouadri ,
To use an external JavaScript library, download the required JavaScript file or open the official URL in a browser and copy the JavaScript content into the module’s Script section or import it.
Once the JavaScript has been added to the module, include the required script reference on the relevant screen and use the JavaScript functionality as needed.
For detailed implementation guidance and best practices, please refer to the official documentation.Hope this will help you.
@Youcef Mammar kouadri : You can use the client action RequireScript (https://success.outsystems.com/documentation/11/reference/outsystems_apis/system_actions/#Client_RequireScript) to include an external Js.
Hey @Youcef Mammar kouadri
Load directly from the CDN
If you don't want to download ExcelJS, use the built-in RequireScript client action. It is specifically suggested in the OutSystems Community for loading external scripts in Reactive Web.
Open your screen's OnInitialize client action.
Add the RequireScript client action from the System module.
Set its script URL argument to:
Publish and test the screen.
Important: Ensure ExcelJS has finished loading before executing new ExcelJS.Workbook(). If your export action runs before the library is ready, you may get ExcelJS is not defined.
For the most reliable setup, use the Required Scripts approach in Option 1, because OutSystems loads required scripts before the screen is rendered.
Official guide: Use JavaScript Code from an External Library — OutSystems 11