- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
How to create and publish catalog client script in service bridge .
Need help to know How to create catalog client script and that to be works on consumer instance side?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks for sharing the error screenshot, that is really helpful context. Let me address each point:
1. What copies over to the consumer instance via Service Bridge
Based on experience, here is what typically flows through and what does not:
What copies over:
- Catalog item definition
- Variables and variable sets
- UI Policies
- Catalog client scripts (with remote script approval)
What does NOT automatically copy over:
- Script Includes (including client callable ones)
- Any server side dependencies the catalog item relies on
This is the root cause of your GlideAjax errors in the screenshot. The client script on the consumer is trying to call a Script Include that only exists on the provider instance, hence the 404 and unhandled exception in GlideAjax errors.
2. How to sync Script Includes from provider to consumer
Unfortunately there is no automatic sync mechanism for Script Includes via Service Bridge. The current approach is manual:
- Export the Script Include from the provider instance as an update set
- Import and commit it on the consumer instance
- This needs to be repeated whenever the Script Include is updated on the provider
3. The /xmlhttp.do 404 error
This confirms the Script Include is missing on the consumer. Since you already manually added it and it is working, that validates the diagnosis. Going forward maintain a separate update set on the provider specifically for Script Includes used by Service Bridge catalog items so they can be easily exported and applied to consumer instances.
Hope this helps clarify the behavior!
ServiceNow Developer & Admin
Builder of NowFixer | Free AI debugging tool for ServiceNow scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Refer this Servicenow Documentation. Hope it will help you.
Also refer this : https://www.servicenow.com/community/technology-forum/service-bridge-client-scripts-and-variable-set...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @supriyapriy,
Provider Side:
- Create Catalog Client Scripts are created on the Provider Instance.
- These scripts are published with the Remote Catalog Item.
- They execute in the consumer's browser at runtime, even though the script record present on the provider instance.
All -> Service Bridge Provider -> Administration -> Remote Catalog Items
Consumer Side:
- Verify it on Consumer Instance.
- Open Service Catalog.
- Open the Remote Catalog Item.
- Check the script behaviour.
Note: You will not see the script in the consumer tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The key thing to understand first:
Client scripts attached to a catalog item on the provider instance do NOT automatically execute on the consumer instance. The consumer instance renders the catalog item but client side scripts need to be handled carefully.
Option 1: Use catalog client scripts with Service Bridge compatibility Make sure your client scripts only use standard GlideForm (g_form) API calls. Avoid any DOM manipulation or instance specific hardcoded values as these will not translate cleanly to the consumer side.
Option 2: Use UI Policies instead where possible UI Policies replicate more reliably across Service Bridge than client scripts. If your requirement is to show/hide or make fields mandatory, a UI Policy is a safer choice.
Important things to avoid in your client scripts for Service Bridge:
- Do not hardcode sys_ids from the provider instance
- Avoid GlideAjax calls that reference provider specific Script Includes unless they are also available on the consumer
- Do not use direct DOM manipulation
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
ServiceNow Developer & Admin
Builder of NowFixer | Free AI debugging tool for ServiceNow scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
