How to add a Script to a Search Sources condition.

Yudai Yamamoto
Mega Guru

I want to add a condition using a script to Search Sources of AI Search.
If you know how to add it, please let me know.

1 ACCEPTED SOLUTION

Isaac Vicentini
Mega Sage
Mega Sage

Hi @Yudai Yamamoto!

 

Currently it is not possible using scripts to perform filters in Search Source , see:

 

➔ ServiceNow Docs - Search sources

IsaacVicentini_0-1727889711871.png

 

Alternatively, you can work with ACLs, if the user does not have permission to see a record due to security permissions, it will automatically not appear in the AI ​​Search results.


If my answer helped you in any way, please mark it as Helpful / Accept as Solution 🎯

Regards,

Isaac Vicentini.


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

View solution in original post

3 REPLIES 3

Isaac Vicentini
Mega Sage
Mega Sage

Hi @Yudai Yamamoto!

 

Currently it is not possible using scripts to perform filters in Search Source , see:

 

➔ ServiceNow Docs - Search sources

IsaacVicentini_0-1727889711871.png

 

Alternatively, you can work with ACLs, if the user does not have permission to see a record due to security permissions, it will automatically not appear in the AI ​​Search results.


If my answer helped you in any way, please mark it as Helpful / Accept as Solution 🎯

Regards,

Isaac Vicentini.


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

jafarhansla
Kilo Contributor

To add a condition using a script for AI Search, you’d typically need to identify the parameters or criteria you want to filter by—like keywords or source types—and implement logic in your script to ensure the search only pulls from relevant sources. For example, if you're searching for 'AI Search' sources related to a specific topic, you'd apply a condition to filter based on that. Speaking of targeted searches, if you're looking for the best Chinese restaurants in Edmonton, you could add a condition to your search to focus on restaurant reviews or specific ratings, helping you narrow down the top spots like The Lingnan or Dynasty Century Palace.

Heverton1
Tera Contributor

I was looking for something like this as well since I need the AI to suggest Knowledge Articles based on the Contact domain.

Dont think this works well for domain separated instances...