Skip Navigation

Search

Prefill values in WCFS widget
Answer ID 13073   |   Last Review Date 11/10/2025

How do I prefill the standard or custom field with a hidden or visible value?

Environment
Chat / Engagement Engine
Oracle B2C Service
Web Chat for Service
 
Resolution

The Web Chat for Service widget can be opened passing default connection data before starting the conversation without any end-user interaction. You can hardcode values or pass them dynamically through a variable. 

When bypassing values automatically, keep in mind that the end users can change these values if you set the fields to be visible on the pre-launch form. For a complete guide on how to add fields to the pre-launch form, see Adding fields to the pre-launch form in WCFS

If you add the field values to your web chat component and also to your rule action, whatever you have configured in your rules will take priority over the component.

Configuration guidance

From the Web Chat Component

  • Click menu Feature Flags in the Web Chat component setup screen
    • Add the property Show Pre Launch Form and select the desired behavior: Always, Initial or Never
  • Click menu Functionality Configuration in the Web Chat component setup screen
    • Add the property Pre Launch Form Fields (List of fields to show in the pre-launch form)
    • Click button Add Pre Launch Form Field Data (do this for every field you want to add)
      • Custom Field Type (default is text)
      • Name (name of your field)
      • Options - Add Pre Launch Form Field Options (values of the field you want to be pre-populated)
      • Relaunch Value (default, keep, clear)
      • Required (true or false)

From the Rules

  • Add Action Web Chat - Update Connection Data
  • Choose Component (the one you created)
  • Connection Data:
    • Source: String with Javascript Variable
    • String with Javascript Variable
      Note: Engagement Engine comes with Example JSON code that you can reuse for your own use case.  Click the icon to copy the Example JSON to the Textarea.

Example 1:
$[[connectionData]]
Note: connectionData is a variable on the page containing connection data object with properties such as firstName, lastName, email, productId, categoryId, subject.

 

Example 2:
{
  "firstName": "$[[firstName]]",
   "lastName": "$[[lastName]]",
   "email": "$[[email]]",
   "subject": "$[[subject]]",
   "productId": "$[[productId]]",
   "categoryId": "$[[categoryId]]"
  }

Note: firstName, lastName, email, subject, productId, categoryId are page variables.


Example 3: 
{
   "subject": "hello",        
   "firstName": "$[[cFirstName]]",
   "lastName": "$[[cLastName]]",
   "email": "$[[cEmailAddress]]",
   "productId": "",
   "categoryId": "3",
   "customFields": [{"name":"dainterface", "value": "$[[VariableInstance]]"},
{"name":"membership_id","value":"member1234"}]

Note: firstName, lastName, email are page variables. subject and categoryId get filled with a hardcoded value.  productId is left bank.  Custom fields are defined in an array.  dainterface get filled with a page variable (eg. interface name).  membership_id gets filled with a hardcoded value.

See also this post in Cloud Customer Connect: Populate Engagement Engine EE Web chat prelaunch email field with logged in email

Notify Me
The page will refresh upon submission. Any pending input will be lost.