Passing variables to web messenger

(Scott Rosano) #1

I have tried for hours and cannot get metadata INTO my web messenger. I have copied and pasted the web messenger code – I have added a callback to the javascript to fire my function which works. In the function I have tried to send metadata via sendMessage and setConfig – neither works. I cannot use the command line url – must be the script. What am I missing from the API??

Here’s my latest try:

function flowXoReady(){
console.log(‘ready’);
FxoMessenger.on(‘stateChanged’, function(state) {
if (state === ‘connected’) {
FxoMessenger.setConfig({
gburl:‘cal6.nsf’,
})}
});
}

(Scott Rosano) #2

and here it is with sendMessage – note the message gets sent – the data does not – uhhhhhhh…

function flowXoReady(){
console.log(‘ready’);
FxoMessenger.on(‘stateChanged’, function(state) {
if (state === ‘connected’) {
FxoMessenger.sendMessage(‘Start’,{user_id:12345,name:‘scott rosano’,gb:‘cal6.nsf’});
}
});
}

(Scott Rosano) #3

This sends the text – does not send the metadata and its nowhere to be seen in logs. This bites!

function flowXoReady(){
console.log(‘ready’);
FxoMessenger.on(‘stateChanged’, function(state) {
if (state === ‘connected’) {
FxoMessenger.sendMessage(‘Start’,{user_id:12345,name:‘scott rosano’,gb:‘cal6.nsf’});
}
});
}

(Scott Rosano) #4

But this works… just can’t do it from the javascript widget

https://fxo.io/m/g3adda6e?name=scott

(Karen Barker) #5

Hi Scott,

I can see that you’ve sent this into our support desk and so I’ve responded there. :slight_smile:

(Scott Rosano) #6

Your solution did not work. the sendMessage is firing – I see the text appear on the message – but none of the variable are being added to metadata. VERY FRUSTRATING!!

(Karen Barker) #7

Hi Scott,

Sorry to hear you’re still having problems with this. If you can please share the full script you are using to trigger the web Messenger and also a screen shot of the trigger details from your interaction logs when you trigger the flow then this will help greatly. For privacy please feel free to share this with us at support@flowxo.com.

Thanks :slight_smile: