Calling Decision Table from script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I have a use case I have created a decision table for auto populating category based on product. if i select any product the category should auto populate based on the product without saving the form itself
So, I want to Use on change(product) client script. So, When I am changing the product based on product category should populate for that i have created decision table for which product which category should come.
but, problem is with I am using script include to call the decision table using DecisionTableAPI()...But its returning null.
could you clarify me...How I need to call and what is the best approach to implement my use case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @KeerthiPraV
Check out these articles:
https://www.servicenow.com/community/developer-blog/how-to-use-decision-table-from-scripts/ba-p/2641...
https://www.servicenow.com/community/developer-blog/servicenow-learning-173-how-to-call-decision-tab...
https://www.servicenow.com/community/workflow-automation-forum/querying-a-decision-table-from-a-cata...
-------------------------------------------------------------------------------------------------------------------------------------------
If my response solves your query, please marked helpful by selecting accept as Solution and Helpful. Let me know if anything else is required.
Thanks,
Prerna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
so share your script include and client script?
is your script include client callable?
is your script include function getting called?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @KeerthiPraV ,
If you getting null when calling script include from client script make sure you are returning the values properly for example - create an array, push the values in an array in form of string using .toString() function or adding +"".
When you getting the return response in your client script make sure to parse that array in callback function of your glideAjax.
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @KeerthiPraV
You can go through the following community posts/articles:
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************