0

I am trying to open a flow with preloaded data. In order to do that, I use the OpenCTI searchAndScreenPop with flowargs parameter as follows:

sforce.opencti.searchAndScreenPop({
    searchParams: '123465',
    queryParams: '',
    params: {
        FLOW: { 
            flowArgs: [
                {
                    'name': 'phone',
                    'type': 'number',
                    'value': 123456
                },
            ]
        }
    },
    callType: 'inbound',
    callback: function (response) {
        console.log(JSON.stringify(response));
    }
});

The flow only contains a Screen element configured as Start with one phone field.

Flow Screenshot

The callback is triggered with {"success":true,"returnValue":{},"errors":null}

In the documentation I can see "Specifies arguments to pass to a flow. flowArgs is a list of objects with key-value pairs containing information about the arguments being passed to the flow. Arguments must correspond to input variables of the specified name and type defined in the flow, else they are ignored."

So, my question is: has anyone achieved opening a flow with searchAndScreenPop passing flowArgs? Am I doing something wrong?

1 Answer 1

0

In order to make it work you need to specify a variable in the flow in which you will store the value passed via params when calling the searchAndScreenPop function.

1.- Create the variable in the Flow:

Variable phone created as Text data type

2.- Link the created variable with the field in the Flow:

enter image description here

3.- Call the Flow with the correct field type:

sforce.opencti.searchAndScreenPop({
    searchParams: '123456',
    queryParams: '',
    params: {
        FLOW: {flowArgs: [{'name': 'phone', 'type': 'String', 'value': '123456'}]}
    },
    callType: 'inbound',
    callback: function (response) {
        console.log(JSON.stringify(response));
    }
});

Result:

enter image description here

Take note of the String data type when calling the searchAndScreenPop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .