How to call script include in scripted rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 10:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 10:46 AM
Hello,
You can utilize any server side API in your scripted rest API.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 03:03 PM
Hello,
I see you're only replying below, but I'll respond up here to keep my chain in tact.
If you're seeing [object, object] that you're getting back from your script include, then that means you're passing an object...instead of string. You'd need to convert your obj to string in your script include and then pass the string value.
This is a separate question to your question above, as your question was how to use a script include in scripted REST API, which I've answered above.
I hope the above answers your question. Thanks! š
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-28-2022 11:27 AM
i am getting like [object object] using below script. how can i resolve this
var test1 = new scriptinclude();
var test= test1.stringify();
// Create New Form
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('item sys_id', 1);
cart.setVariable(item, "user", test);