Author Topic: Add custom field into Genesys Chat/Email widgets  (Read 1782 times)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Add custom field into Genesys Chat/Email widgets
« on: November 18, 2017, 04:10:42 AM »
Hi guys
I have been looking around and couldn't find a way (documented and supported at least) on how to add a custom field into the Widgets...for example Passport Number, ID, some drop down object...
any idea?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2604
  • Karma: 42
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #2 on: November 21, 2017, 12:03:37 AM »
I have done that but it doesn't go as a KVP as first fields.
I see there is a userdata property but no clue on how to work with it...

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #3 on: November 21, 2017, 12:05:03 AM »
Also this is for Chat, but no mention of email form...
Will ask support if it is the same

Offline jamesmurphyau

  • Full Member
  • ***
  • Posts: 117
  • Karma: 1
Re: Add custom field into Genesys Chat/Email widgets
« Reply #4 on: November 21, 2017, 02:10:22 PM »
As far as I can tell from reading the docs, you canít edit or add to the out of the box registration forms but you can create your own..

I found these links they seem like they might be useful (havenít actually tried doing it yet though)

https://developer.genesys.com/2017/08/31/draft-genesys-widgets-customization-starting-with-simple-examples-i/

https://developer.genesys.com/2017/09/15/genesys-widgets-customization-filling-registration-form-data-ii/

Creating an account is free and instant if you donít have one

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #5 on: November 21, 2017, 09:27:48 PM »
I have checked those already, and still they are fixed with same fields, no sample which add a new one anywhere.
They show how to interact with the JScript part, I want to add custom KVPs and fields as are usually done at customer needs.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #6 on: November 21, 2017, 10:44:40 PM »

Ok, I can attach data from the call.


           
Code: [Select]
dataURL: "http://192.168.0.110:8380/genesys/2/email/TEST1",
            apikey: "",
            userData: {var2:"jojojo"},




            SendMessageButton: {
            enabled: true
            }


But now need to add to this userData JSON some value from a the form field.
Will keep testing
« Last Edit: November 22, 2017, 08:46:10 PM by cavagnaro »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #7 on: November 21, 2017, 11:12:18 PM »

OK found it


You first need to find this line:


Code: [Select]
c.userData = n

Then add


Code: [Select]
c.userData = n,
c.userData.var99 = a("#cx_sendmessage_form_var1").val(),

where #cx_sendmessage_form_var1 is the form field you added before (following Genesys docs)
and var99 is the KVP key name you want.

So at logs I have now:

Code: [Select]


12:05:20.099 Dbg 09900 SendEmailTask webRequestId [10000014], Sending request to E-mail Server: 'RequestCreateWebEmailIn'('50')
message attributes:
FromAddress = cavagnaro.jc@gmail.com
ReferenceId = 10000014
QueueEndpoint = default
Mailbox = genesys@domaintest.com
UserData = KVList:
   'var99' [str] = "Var1cavagnaro"
   'var2' [str] = "jojojo"
FirstName = Jorge
Text =  ewfdsfs
LastName = Cornejo
Subject = Test1




Works fine


If someone finds an easier way to do so please share
« Last Edit: November 22, 2017, 08:49:31 PM by cavagnaro »

Offline Litsedei

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Add custom field into Genesys Chat/Email widgets
« Reply #8 on: November 22, 2017, 07:17:36 PM »
Hi,
I see in the widgets.min.js command "Survey.open"
who has ideas for this use case? ???

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7040
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #9 on: November 22, 2017, 08:50:09 PM »
Guess will be the webform used on WebAPI to send surveys