Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You can pass the parameters from the msg object to other variables and use them in Experience Designer.

  1. You need to assign variables within a session to the values that you wanted to capture.

  2. You need to call these variables in the Experience designer flows.

In the below example, we have captured the cookie from msg.req.headers.cookie and assigned it to a variable cookie_id and sent it to the session.

  1. Copy the below code to Bot In parser of the Bot Provider V2 node.

      if (msg.payload.originalRequest) {
        msg.payload.originalRequest.data = {
          cookie_id: msg.req.headers.cookie
        }
      }
  2. Place the below code in the function node in the Experience Designer.

    if (msg.payload.originalRequest && msg.payload.originalRequest.data) {
      var session_cookie_id = msg.payload.originalRequest.data.cookie_id
    }
    return msg;
  3. Trigger the flow that contains the function node and you can see the variable cookie_id at msg.payload.originalDetectIntentRequest.payload.cookie_id

Related article

  • No labels