Pass participant data - WebMessaging

I am trying to pass information from the site into my MessageFlow by using the Database plugin.

I found this previous topic: Participant Data in Webmessaging - #2 by Frederic_Thomas which is more or less exactly what I want to do. But I can't seem to figure out the step 2 in the solution. I can't seem to be able to refer to the data I set via the Database plugin when I am in the Message Flow (GetParticipantData).

I have created a script that looks like this:
Genesys("command", "Database.set", { messaging: { customAttributes: { MyParam: "Web site test" }}});

In my My MessageFlow I want to assign the "MyParam"-attribute to a Flow-variable. How should that assignment look?

Hi Johan - does this example help?

https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/pluginExamples#define-and-send-custom-attributes

Hi Angelo,
Thanks for the super quick response!
The part where I set the attributes, update them, get them via the javascript works just fine. The place where I struggle is when I want to refer to the attribute in the messageFlow.

I have use a GetParticipantData in the flow, but how do I refer to the attribute in here and assign it to a flow-attribute. If feels like I am missing something silly here :slight_smile:

The way I have it working is:

  1. Before conversation starts, use this command via browser console (for testing):

Genesys("command", "Database.set", {messaging: {customAttributes: {department: "Support"}}})

  1. My Inbound Message Flow is storing the value of department in local variable State.Department:

  1. You can then re-use that variable elsewhere in the Flow, for example just value echo back, to confirm that it works properly, using Send Response action, your Expression might be as simple as "We'll get you to: " + State.Department:

  1. If you start the conversation, the Messenger should show you that echo message:

image

Hope it helps!

Great! Works just fine. Thanks!

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