Not getting updated attributes from web messaging widget

Hello,

I'm having trouble getting to reflect the updated attributes to the participant data. When a new inbound message is received along with the custom attributes, the participant data doesn't get immediately updated. Instead, it will update when the next message is received.

Code:

  <script type="text/javascript" charset="utf-8">
    (function (g, e, n, es, ys) {
      g['_genesysJs'] = e;
      g[e] = g[e] || function () {
        (g[e].q = g[e].q || []).push(arguments)
      };
      g[e].t = 1 * new Date();
      g[e].c = es;
      ys = document.createElement('script'); ys.async = 1; ys.src = n; ys.charset = 'utf-8'; document.head.appendChild(ys);
    })(window, 'Genesys', 'https://apps.usw2.pure.cloud/genesys-bootstrap/genesys.min.js', {
      environment: 'prod-usw2',
      deploymentId: '8de86cd1-9d06-4a8b-acf1-f8bccf0a474e'
    });

    let query
    Genesys("subscribe", "MessagingService.messagesReceived", function ({ data }) {
      if (data.messages[0].direction === "Inbound") {
        query = data.messages[0].text;
        console.log(data);
        Genesys(
          "command",
          "Database.update",
          { messaging: { customAttributes: { "query": query } } },
          function (data) {
            /* fulfilled, returns data */
            return true
          },
          function () {
            return false
            /* rejected */
          }
        );
      }
    });
  </script>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.