Search code examples
twiliotwilio-functions

Twilio Studio Function Parameter


I am trying to pass a parameter to a function in a flow using Twilio Studio. I can add the parameter no problem to the function widget, but how do I retrieve the parameter in the function?

Studio Screenshot

enter image description here

I've tried looking at the logs and can't figure out how to reference the parameter.


Solution

  • The parameters are properties of the event object, you can access with the dot notation. In your case something like this:

    exports.handler = function(context, event, callback) {
    
        const test = event.Test; 
    
        // your function code here...
    
    
    };