---
sourceDocument: Brazil Conversational Interfaces
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/conversational-interfaces

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Conversational Interfaces

ft:clusterId :

    - convint

bundleId :

    - convint

workflow :

    - Platform


---

# Multi-response output controls

# Multi-response output controls {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Multi-response output controls

Multi-response output controls in ServiceNow enable complex user input workflows involving multiple interaction steps, such as paginated selections or sequential date picking (year, then month, then date).
This functionality enhances user experience by managing multi-step input processes efficiently within conversational interfaces.
Show full answer Show less  
The multi-response control APIs are designed for use exclusively in inbound and outbound transformers, allowing you to store, retrieve, and manage user-specific context data throughout the interaction.

## Key Features

* **Context Data Management:** Use APIs like `setProviderUserContext`, `getProviderUserContext`, `removeProviderUserContext`, and `removeAllProviderUserContext` to maintain user context for multi-step controls.
* **Pagination Support:** Implement paginated pickers by storing current page details (e.g., page index and pagination length) in user context, enabling next/previous navigation within the picker control.
* **Step-by-step Input Handling:** Support sequential selection processes such as date pickers that proceed through year, month, and date inputs in order.
* **Transformer Examples Provided:** Code snippets demonstrate how to manage pagination state in outbound transformers to display options by page and how to process user selections and update pagination in inbound transformers.

## Practical Application for ServiceNow Customers

By leveraging these APIs and transformer patterns, ServiceNow customers can build conversational interfaces that handle complex input scenarios without losing user progress or context. This improves user engagement and accuracy in data collection, especially in chatbots or virtual assistants requiring multi-step inputs.

Implementing multi-response output controls allows you to:

* Maintain stateful interactions across multiple user inputs.
* Enable intuitive navigation within option lists, avoiding overwhelming users with too many choices at once.
* Customize input flows to match business needs such as paginated selections or guided date entry.

Overall, these controls provide a robust framework for enhancing user input interactions in ServiceNow virtual agent experiences.  
Implement controls that involve multiple steps to get user input.
Use the following API to configure context data for multi-output controls.

## Common use cases {#ccci-multi-flow-output-controls__section_q3n_xht_h4b}

1. To achieve pagination of pickers: page_no, pagination_length updated in inbound based on next/previous button is read in outbound.
2. Step by step response of date picker like first year, then month, and then date selection.
{#ccci-multi-flow-output-controls__ol_mbj_yht_h4b} The following APIs are only available in inbound and outbound transformers.

    sn_cs.VASystemObject.setProviderUserContext( key, contextData, providerAppId, providerUserId);
    sn_cs.VASystemObject.getProviderUserContext(key, providerAppId, providerUserId);
    sn_cs.VASystemObject.removeProviderUserContext(key, providerAppId, providerUserId);
    sn_cs.VASystemObject.removeAllProviderUserContext(providerAppId, providerUserId)

The outbound transformer of the picker control can store current page details in user contextData.

     var paginationData = {
              "page_index": 1,
              "pagination_length": 2
        }
    };
    sn_cs.VASystemObject.setProviderUserContext("picker_pagination", paginationData, providerAppId, providerUserId, );

The inbound transformer of picker control can get current page details from user contextData.

    var paginationData = sn_cs.VASystemObject.getProviderUserContext("picker_pagination", providerAppId, providerUserId);

## Example code for picker control outbound transformer {#ccci-multi-flow-output-controls__section_cvt_p3t_h4b}

    (function execute(inputs, outputs) {
        var control = inputs.rich_control;
        var payload = inputs.payload;
        var appId = payload.appId;
        var userId = payload.userId;

        var paginationData = sn_cs.VASystemObject.getProviderUserContext('picker_control', appId, userId);
        paginationData = JSON.parse(paginationData);
        //First time when the outbound picker is called when selecting the topic.
        if (paginationData == null) {
            paginationData = {
                'page_index': 1,
                'pagination_length': 5
            };
            sn_cs.VASystemObject.setProviderUserContext('picker_control', paginationData, appId, userId);
        }

        var page_index = paginationData['page_index'];
        var pagination_length = paginationData['pagination_length'];
        var start = (page_index - 1) * pagination_length;
        var end = page_index * pagination_length;

        if (control['options']) {
            var options = control['options'];
            var optionsLength = options.length;
            if (end > optionsLength)
                end = optionsLength;
            var picker = control["label"] + ":";
            if (start > 0)
                picker += "\n" + "*" + ": " + "prev";
            for (var x = start; x < end; x++) {
                gs.log("here " + x + " : " + options[x]);
                picker += "\n" + (x + 1) + ": " + options[x].label;
            }
            if (end < optionsLength)
                picker += "\n" + "#" + ": " + "next";
        }
        outputs.text_message = picker;
    })(inputs, outputs);
    Example Picker Control Inbound Tranformer
    (function execute(inputs, outputs) {

        var request_context = inputs.request_context;
        var rich_control = inputs.rich_control;
        var appId = request_context.appId;
        var userId = request_context.userId;

        var selectedValue = request_context["typed_value"];
        var result = {};
        result["value"] = "";
        result["search_text"] = selectedValue;

        var options = rich_control['options'];

        var paginationData = sn_cs.VASystemObject.getProviderUserContext('picker_control', appId, userId);
        paginationData = JSON.parse(paginationData);

        switch (selectedValue) {
            case 'prev': {
                --paginationData["page_index"];
                result["send_prev_control"] = true;
            }
            break;
        case 'next': {
            ++paginationData["page_index"];
            result["send_prev_control"] = true;
        }
        break;
        default: {
            var selectedIndex = Number(selectedValue) - 1;
            if (paginationData["page_index"] != undefined && paginationData["pagination_length"] != undefined) {
                var highestOptionInPage = paginationData["page_index"] * paginationData["pagination_length"];
                if (selectedIndex >= 0 && selectedIndex < highestOptionInPage) {
                    var selectedOption = options[selectedIndex];
                    result["value"] = selectedOption.value;
                    result["search_text"] = "";
                }
            } else {
                var selectedOption = options[selectedIndex];
                result["value"] = selectedOption.value;
                result["search_text"] = "";
            }
        }
        }
        sn_cs.VASystemObject.setProviderUserContext('picker_control', paginationData, appId, userId);
        outputs.result = result;
    })(inputs, outputs);


