" /> Add custom field into Genesys Chat/Email widgets - Genesys CTI User Forum

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

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Add custom field into Genesys Chat/Email widgets
« on: November 17, 2017, 07:10:42 PM »
Advertisement
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: 2755
  • Karma: 44
Re: Add custom field into Genesys Chat/Email widgets
« Reply #1 on: November 20, 2017, 08:50:56 AM »
Follow this link https://docs.genesys.com/Documentation/GWC/G-NINE/WidgetsAPI/CustCRF

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #2 on: November 20, 2017, 03:03:37 PM »
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: 7641
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #3 on: November 20, 2017, 03:05:03 PM »
Also this is for Chat, but no mention of email form...
Will ask support if it is the same

Offline jamesmurphyau

  • Full Member
  • ***
  • Posts: 123
  • Karma: 2
Re: Add custom field into Genesys Chat/Email widgets
« Reply #4 on: November 21, 2017, 05:10:22 AM »
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: 7641
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #5 on: November 21, 2017, 12: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: 7641
  • Karma: 56330
Re: Add custom field into Genesys Chat/Email widgets
« Reply #6 on: November 21, 2017, 01:44:40 PM »

Ok, I can attach data from the call.


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




            SendMessageButton: {
            enabled: true
            }
[/code]


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

Offline cavagnaro

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

[font=verdana, arial, helvetica, sans-serif]OK found it[/font]


[font=verdana, arial, helvetica, sans-serif]You first need to find this line:[/font]


[code]
c.userData = n
[/code]

[font=verdana, arial, helvetica, sans-serif]Then add[/font]


[code]
c.userData = n,
c.userData.var99 = a("#cx_sendmessage_form_var1").val(),
[/code]

[font=verdana, arial, helvetica, sans-serif]where #cx_sendmessage_form_var1 is the form field you added before (following Genesys docs)[/font]
[font=verdana, arial, helvetica, sans-serif]and var99 is the KVP key name you want.[/font]

[font=verdana, arial, helvetica, sans-serif]So at logs I have now:[/font]

[code]


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
[/code]




[font=verdana, arial, helvetica, sans-serif]Works fine[/font]


[font=verdana, arial, helvetica, sans-serif]If someone finds an easier way to do so please share[/font]
« Last Edit: November 22, 2017, 11:49:31 AM by cavagnaro »

Offline Litsedei

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

Offline cavagnaro

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