Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Virtual Agent API – HR Case Categories limited to 10 results (paginationBreak)

Andr_1
Tera Expert

Hello everyone,

I have configured the Virtual Agent API in my ServiceNow instance and I am currently testing the integration using Postman. So far, the connection is working as expected.

My Virtual Agent is using the HR scope, and I have a requirement related to opening an HR Case via the Virtual Agent API.

When the bot asks the user to select a category for the HR Case, the API response returns a list of available categories. However, I noticed that:

  • I have 15 HR categories configured in the system
  • The API response only returns the first 10 categories
  • In the response payload, I can see the parameter "paginationBreak": 10

Because of this limitation, only the first 10 categories are displayed to the user, and the remaining ones are not available for selection.


My questions are:

  • Is this pagination limit (paginationBreak = 10) configurable?
  • If so, where can it be changed so that all categories are returned in the API response?
  • If not, what is the recommended approach to retrieve or display all HR categories when opening an HR Case via the Virtual Agent API?

This is the original payload I am sending:

{
    "requestId": "1234567",
    "token": "LWFGG6?xVf7uZ47Z",
   "action": "START_CONVERSATION",
    "message": {
        "text": "",
        "typed": true
   
       
    },
    "userId": "xxxxxxxxxx",
    "emailId": "xxxxxxxxxx",
    "contextVariables": {
        "requester_session_language": "en"
    }
   
}

response:
{
    "requestId": "1234567",
    "message": {
        "text": "",
        "typed": true
    },
    "userId": "xxxxxxx",
    "interactionId": "9ced2eb9c36fb65047e2554bb0013155",
    "body": [
        {
            "uiType": "ActionMsg",
            "actionType": "StartConversation",
            "conversationId": "50ed2eb9c36fb65047e2554bb0013154",
            "messageId": "20ed2eb9c36fb65047e2554bb001318a"
        },
        {
            "uiType": "Picker",
            "group": "DefaultPicker",
            "required": true,
            "nluTextEnabled": false,
            "label": "Please choose the category that best matches your question...",
            "scriptedData": null,
            "multiSelect": false,
            "rawSynthesizedResultAsString": null,
            "smartLinksMetadata": null,
            "hideControl": false,
            "itemType": "List",
            "options": [
                {
                    "label": "Return to main menu",
                    "value": "return",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "My personal details & requests",
                    "value": "eff43bbbdb6dfb005b8e5947f49619bf",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "My pay, benefits & recognition",
                    "value": "b570500cdbbdfb005b8e5947f4961966",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "My time off or other type of absence",
                    "value": "f333d48cdbbdfb005b8e5947f49619ac",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "Performance management",
                    "value": "4dd0cdc6dbedb7005b8e5947f4961943",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "Promotions, demotions or lateral moves",
                    "value": "d6fa0094dbb133005b8e5947f496194d",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "Learning  & development",
                    "value": "89ae68cadbadb7005b8e5947f49619a0",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "My travel & expenses",
                    "value": "d8071040dbfdfb005b8e5947f4961925",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "Hiring & onboarding employees",
                    "value": "5865d000dbfdfb005b8e5947f49619e5",
                    "renderStyle": "data",
                    "enabled": true
                },
                {
                    "label": "End of employment",
                    "value": "fe3b0094dbb133005b8e5947f4961950",
                    "renderStyle": "data",
                    "enabled": true
                }
            ],
            "pageNumber": 1,
            "hasNextPage": true,
            "hasPreviousPage": false,
            "paginationBreak": 10,
            "totalSearchResultsCount": 0,
            "style": "list",
            "totalResultsCount": 15,
            "messageId": "8ded2eb9c36fb65047e2554bb00131a3"
        }
    ],
    "score": 1
}

Any guidance or best practices would be greatly appreciated.

Thank you in advance.
André

0 REPLIES 0