How to fix it
- Open your browser's Developer Tools (F12) and check the Console tab for JavaScript errors when the widget loads.
- Navigate to
System Logs > System Log > Alland filter by your widget name to check for server-side script errors. - If errors are found, go to
Service Portal > Widgets, open your widget, and review the Server script for syntax errors, undefined variables, or missing try-catch blocks. - Add debugging to your server script by inserting
gs.log('Debug: ' + JSON.stringify(data), 'WidgetDebug')before the final data assignment to verify what data is being created. - Test your GlideRecord query independently by running it in
System Definition > Scripts - Backgroundto verify it returns expected records. - In the widget's Client controller, add
console.log('Client data:', $scope.data)to verify the data object is reaching the client side correctly. - Check ACL permissions by navigating to
System Security > Access Control (ACL)and filtering by your target table name to ensure portal users have read access. - If ACLs are blocking access, either modify the ACL conditions or ensure your portal user has the required roles listed in the ACL's
Requires rolefield. - Review the widget's Option Schema and ensure default values match what your server script expects, particularly for required parameters.
- Verify your HTML template references
data.propertyNamecorrectly and matches the property names assigned in your server script. - Clear your browser cache and refresh the portal page to ensure you're seeing the latest widget version.
Quick verification: Add gs.log('Widget loaded successfully', 'WidgetTest') at the end of your server script, then check System Logs to confirm the script executes completely without errors.