Author Topic: How do you get interaction user data? WDE customization  (Read 2876 times)

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
How do you get interaction user data? WDE customization
« on: July 15, 2019, 11:52:37 PM »
Hello,

I am trying to find the method to get a userdata key value from the interaction so it can be used to start a browser.
this is what I tried so far.
At the event ringing , WDE extracts the value of key ('URL_Field') and starts a browser ('http://www.genesys.com).
I have added a messagebox to confirm the value is extracted but that brings a blank response when call lands in WDE.
Tried a few other code snippets without success so not sure whether I am using an invalid method.
essentially I just want to take the key value and use it to start a browser in a new window.

[i][b]//…...
case EventRinging.MessageId:
                        // Do your processing here
                        var Url = string.Empty;

                        KeyValueCollection attachedData = interaction.AttachedDataInformation;
                        if (attachedData.ContainsKey("URL_Field"))
                            Url = attachedData["URL_Field"].ToString();

                        IWMessageBoxView.Show("Interaction Created: " + Url, IWMessageBoxButtons.Ok, MessageBoxIcon.Information);

                        System.Diagnostics.Process.Start(Url);
//…..[/b][/i]


thanks

Marked as best answer by PFCCWA on July 17, 2019, 04:09:30 AM

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: How do you get interaction user data? WDE customization
« Reply #1 on: July 16, 2019, 08:42:17 AM »
Try this:

            [code]
            if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
            {
                return interaction.GetAllAttachedData()["URL_Field"] as string;
            }[/code]

Offline jamesmurphyau

  • Full Member
  • ***
  • Posts: 123
  • Karma: 2
Re: How do you get interaction user data? WDE customization
« Reply #2 on: July 16, 2019, 09:13:23 AM »
GetAllAttachedData() is definitely the way to go

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Re: How do you get interaction user data? WDE customization
« Reply #3 on: July 16, 2019, 03:30:35 PM »
[quote author=PeteHoyle link=topic=11389.msg51938#msg51938 date=1563266537]
Try this:

            [code]
            if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
            {
                return interaction.GetAllAttachedData()["URL_Field"] as string;
            }[/code]
[/quote]


thank you , worked like a treat.
This is the full portion of the code I used in the end after the EventRinging..

[i][b]//…...
{
                    case EventRinging.MessageId:
                        // Do your processing here
                        var Url = string.Empty;

                        KeyValueCollection attachedData = interaction.AttachedDataInformation;
                        if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
                        Url = interaction.GetAllAttachedData()["URL_Field"] as string;

                        IWMessageBoxView.Show("Interaction Created: " + Url, IWMessageBoxButtons.Ok, MessageBoxIcon.Information);

                        System.Diagnostics.Process.Start(Url);

                        break;
//….[/b][/i]