ServiceNow Support Portal URLs in M365 Graph Connector
By Anatoly Mironov
Microsoft provides great out-of-the-box Graph Connectors for ServiceNow. The only thing you need is just to set it up. You don’t need own backend infrastructure, no scheduled tasks. Great. But there are some caveats. In this post I would like to share my insights on the Support Portal URLs.
ServiceNow Support Portal
There is a “backend” interface (ServiceNow) and there is an end user portal (often called “Support Portal”, but the name can vary).
The graph connector pulls the data from ServiceNow and presents them in the search results, the urls point to the “backend” part. This is a problem, because most end users do not have access to or want to see the backend/raw side of it.
URL manipulation
It’s not that easy to find for a solution on the internet. There is an answer on the ServiceNow KnowledgeBase Graph Connector troubleshooting page. ResultTypes is what controls how the search results are presented and what they are linked to. You have to edit the display of a result (a.k.a. adaptive card). See the same link above for more details. I’ll summarize the changes in the end of the post.
The solution provided is for Knowledge Base articles. This problem is not mentioned for the Service Catalog (which is a separate connector by the way).
I tried to use the same logic for the Service Catalog and it actually worked! Just copy the url structure of a result on the search page in your SupportPortal and replace the actual sysid with the ${SysId}
variable.
Items vs. Guides in the Service Catalog
Another bump in the road is the fact that some items (sc_cat_item
) belong to a collection, a “guide” in ServiceNow (sc_cat_item_guide
). To me as a ServiceNow rookie, the naming is a bit confusing, but after some digging, I found that a guide is a summary page for related Service Catalog Items.
To mimic the Support Portal Search, you have to know which is a guide and which is an item. I haven’t found a way to get this information.
Only “items” are retrieved
According to the documentation the Service Catalog Graph Connector only retrieves items, right? Or does it also retrieve the guides. The documentation is not very clear. What is clear is that if you set it up the default way, you won’t get the guides. You can check this by entering an appropriate SysId in the Index Browser on the connector.
The URLs
So in the Search and Intelligence, go to Customizations, Result Types, edit the adaptive cards.
Find and replace ${AccessUrl}
with
KnowledgeBase:
https://YOUR-INSTANCE.service-now.com/sp?id=kb_article_view&sysparm_article=${Number}
ServiceCatalog:
https://YOUR-INSTANCE.service-now.com/sp?id=sc_cat_item&sys_id=${SysId}
NOTE: sp
might be something else in your instance setup, just check in your environment.
Room for improvement
It might be already, I just haven’t found it yet. I would love to hear some advice on where to look. It bothers me that:
- The guides are not retrieved from ServiceNow, nor is it possible to determine whether they are items or guides. I already mentioned this above.
- The URL manipulation feels hacky. Shouldn’t there be a property for the corresponding Support Portal URL value? The url of ServiceNow instance and “/sp” part are hardcoded, that makes staging it through DEV TEST and PRODUCTION less smooth.
But this is better than nothing, right?