# Dynamic input

This input component provides merge field input and renders another component using data from the merge field.

Preview

In order to use dynamic input you should prepare formatted data for the component. For instance, using Execute JavaScript Code step we can send the RWC Attachment input component as a single object:

return {
  name: "rwc-attachment",
  showComponentInMessage: true,
  keepComponentInThreadAfterSubmit: false,
  vBind:{
     name:"rwc-attachment",
     isMulti:"1",
     filesValidation:true,
     isPrivate:true,
     allowedFileTypes:[
        "JSON",
        "CSS"
     ],
     maxSize:1000,
     maxSizeOption:"file"
  }
}

or as an array with multiple components:

return [
   {
      name: 'rwc-text',
      showComponentInMessage: true,
      vBind: {
         text: 'Some text in message'
      }
   },
   {
      name: "rwc-attachment",
      showComponentInMessage: true,
      keepComponentInThreadAfterSubmit: false,
      vBind:{
         name:"rwc-attachment",
         isMulti:"1",
         filesValidation:true,
         isPrivate:true,
         allowedFileTypes:[
            "JSON",
            "CSS"
         ],
         maxSize:1000,
         maxSizeOption:"file"
      }
   }
]

In the examples above there are the following fields (properties) in the data:

name – the name of the component. This is a system property that helps us to convert data into a correct format. showComponentInMessage – setting for re rendering component in a bubble. keepComponentInThreadAfterSubmit – setting for keeping request-response component in the chat after submit. vBind – settings for the component.

# Examples

The full list of components and their setting you can find in file below: Download component settings list

Last Updated: 8/1/2023, 7:32:10 PM