I must clarify that in the conversation no data is sent through the database.set command, but through a flow of architect data is obtained from the guest.
database.get is able to obtain data from the participant? or it only works when during the conversation messages are sent from the guest?
I remain attentive to any help that you can give me.
I may not be able to follow the context of your use-case, but I will try explaining how Database plugin works so you can leverage the usage from it.
Any data that is set using Database.set command, is held with in the Database plugin browser instance (think of it like local variables in Javascript) and it sent along during the conversation when messages are sent from the guest.
Whenever the web page is refreshed, this data is wiped off and needs to be set again using Database.set command. Similarly, when conversation is expired or ended (when clear conversation is enabled) this data is wiped off from the local instance and needs to be set again if you require.
Coming to your example above, it needs a correction in the syntax. With Database.get command, you can only pass the property name that you want to fetch. So, it should be:
// To return specific property value - in this case SSP
Genesys("command", "Database.get", { name: "messaging.customAttributes.SSP" }, function(data){ /* fulfilled, returns data */});
or
// To return entire object `messaging.customAttributes` data
Genesys("command", "Database.get", { name: "messaging.customAttributes" }, function(data){ /* fulfilled, returns data */});
Let me know if this helps or require any more information.
Thank you very much for the explanation. I certainly did not raise my specific use case. Specifically I thought it was possible to get data from the participant by using the “Database.get” command. At one point I assumed that it was possible because in other occasions I have used the “Database.set” command to attach information from the client, such as the URL where it is located among other things, and this data remains in the participant data, so let's say that this would be the reverse process, but from the data that is in the interaction.
Is there any way that I can have access to this participant data from the web messaging script, and then process and update it?
You can only retrieve the data that is set using Database.set command, meaning Database.get command will only return the data that is previously set using Database.set command.
To modify any data previously set, you can use Database.update command. All these commands can be used as needed before starting a conversation or after the conversation is started.