logo

NJP

Contextual Search in ServiceNow: Adding Contextual Search to Custom Tables for Beginners!

Import · Nov 23, 2023 · video

Hi everyone, and welcome back to our ServiceNow 
Simplified Series. If you are new here, don't   forget to hit the Subscribe button and ring that 
bell for more ServiceNow tips and tricks. Today,   we are diving into something really cool: 
setting up contextual search for a custom   table in ServiceNow. Whether you are 
a seasoned pro or just starting out,   you'll find this guide super 
helpful. So, let's get started. First things first, let's talk about what 
contextual search is. In simple terms,   it's a way to find records in ServiceNow 
that are related to the one you are currently   looking at. It's super handy for linking 
incidents to problems or changes. But today,   we are going to set it up for a custom table, so 
stick with me, and you will see how easy it is. So, basically, what we'll be doing in today's 
tutorial is looking into the Meeting Room Booker   application. Basically, what I want is to add the 
contextual search on the Booking Feedback table.   Okay, so basically, what exactly is contextual 
search? Contextual search is a search parameter,   a search entity on the form, using which you 
can search knowledge bases, catalogs, and so on. Okay, so we'll be setting it up on this 
particular form. I will show you the form;   currently, there is nothing there. So, if I 
open this... yep, nothing there, right. So,   in order to set it up, what you have to 
do is just go to the filter navigator,   and this module we'll be using for the 
contextual search. I already made it a favorite. Okay, and first of all, let's look into the 
Searcher. We have something called Searcher,   which is an out-of-the-box defined thing, 
and you can't define your own logics over   there. That's why you are not able to see any 
new button out there. Basically, a searcher is   a criteria defined for where you want to have 
your contextual search results come from. So,   you can decide whether you want to search only 
from the catalog, or you want to search it from   knowledge and catalog, or you want to search 
from knowledge which are pinned, and so on. Okay, so we'll be using this searcher in order to 
set up the contextual search. For that, what you   have to do is just go to the search context, click 
on "New," and you have to give it a name. So,   I will give it the name as "Booking Feedback." 
Short description: I will just copy-paste the   same; you can elaborate if you want. And 
you can select the Searcher. So, I want   this particular search to happen on the knowledge 
and catalog items. Okay, and we can just save it. Out, so this is done, right? And now you can go to 
table configuration, click on "New," and here you   can select the table. So, it's "Booking Feedback," 
right? Booking feedback, this particular table. Out, not selected, right? I start reflecting. Why? Let's do one thing: let's try the other 
way because I'm not able to select it out. So,   let's go and find a way out. I leave 
this out, and I will just go... Yeah, technical name F-back. I'll just 
copy it. Favorites, search context,   booking feedback, table configuration, we click 
on "New," the table, I will do a double click,   I will directly put the value. Okay, back. We 
got the table. UI type, you can select. So,   it's platform workspace. Currently, we 
are looking at the platform. Title, UI,   I will just give "Booking Search." Working 
search, and it's enabled, related search,   enabled source selector. Okay, you can select 
anything. So, I can give "When to Display," so   "When to Display," I will keep it as is, but 
you can add it out, and searches. So, searches   feature, if you are not enabled, so basically, 
what happens, you know, ServiceNow is full of   restrictions, ACLs, and all those things, right? 
So, you have access to certain requests out, but   in case you want to search as someone else, okay, 
so you can enable this "Enable Search As." So,   as soon as you enable this enable searcher, 
you can define which particular field, okay,   on the particular form, you want to have searched 
upon. So, for example, if you are a caller, so   enable search as caller, so it will only showcase 
those things which are visible to caller. Okay,   so for now, I will just keep it as is, I don't 
want to make it complex, and we can save it. So, we are done with the saving part. We can go 
again, and if we go to this particular table now,   okay, and if we go to this table now, let's see, 
booking feedbacks, and if you open a record,   nothing out there, right? So, you have to do 
"Configure Form Design," and on the form design,   you can see now, "Contextual Search Result," 
isn't it amazing? Right, we'll pull it out,   and we can save the form. So now, it 
should be visible on the record. Okay,   so how can we see that? We can simply do "Control 
Tab," we can go back to the record, refresh... No,   it didn't come up. Booking feedback, I will 
open some other record. Oh, did I not add it   to "Configure Form Layout"? Let's look if we 
missed some setting out there. All favorite,   search context, booking feedback, it's 
active, enable Wild Card search, is okay,   this is fine. Search configuration is catalog and 
knowledge, we want to go on table configurations,   enable search. So, it's field, okay, search 
field, we have to give. Let's give it as...   What fields can we give? On comments, okay, that 
this will be one of the things. So, basically,   what it means is which particular field you want 
to take into consideration while searching. Okay,   perfect. Email configuration, I don't want to 
search configuration, let's go back. History, that   booking feedback, I open, still no, configure only 
out. Let's try this option, and we have this... Context, why it's not coming up? Then say, 
am I missing something? No, I don't think   so. Display configurations, no, not this one. 
Okay, is it required to be in ask-as-stand?   It's... Let's display also... Command, it's not 
empty. Okay, so we have to give the condition,   right? We are missing the condition. And now, 
if you look at the booking search result,   so you can see this out, okay? Related, this, and 
you can search anything out, for example, access,   so it will give all the access-related things 
which are there on the catalogs as well as on the   knowledge base. And as we have given, it's based 
on comments, right? So, if you type something out,   for example, if you give "email," so it will 
have the search based on that email out there. So, this is how it works. Okay, and we have added 
it; we have successfully added it on the custom   table. So, you can play around with it. If you 
want to look into the configurations around the   same, there are tons of configurations. So, if I 
go to the context search, so you can see, there   are record producer configurations, there are 
table-based configurations. If you want to change   the wizard, you can do that. Result configuration, 
you can add subtexts, all those things out. For   example, if I go to the knowledge articles, okay, 
which knowledge articles we want to see? So,   over here, we have these conditions and example 
articles, right? So, if you click on this... Conditions, so you can see a condition that before 
searching, the condition must be an encoded query.   So, you can put the encoded query over here. 
This encoded query will be applied, okay, on the   knowledge searches, okay, during the contextual 
search. So, you, this is all the features,   and this, in today's study, we have seen how we 
can add the contextual search on the custom table,   and I hope you liked it. So, thanks for watching, 
everyone. I hope this guide helps you to make   the most of ServiceNow contextual search. If 
you have any questions or tips of your own,   drop them in the comment below. And, as 
always, happy ServiceNow-ing. Thank you!

View original source

https://www.youtube.com/watch?v=3oVDw_LQYI0