Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: cavagnaro on November 17, 2017, 07:10:42 PM

Title: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro on November 17, 2017, 07:10:42 PM
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?
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: Kubig on November 20, 2017, 08:50:56 AM
Follow this link https://docs.genesys.com/Documentation/GWC/G-NINE/WidgetsAPI/CustCRF
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro 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...
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro 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
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: jamesmurphyau 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
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro 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.
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro 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
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro 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]
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: Litsedei 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? ???
Title: Re: Add custom field into Genesys Chat/Email widgets
Post by: cavagnaro on November 22, 2017, 11:50:09 AM
Guess will be the webform used on WebAPI to send surveys