Actions/Triggers in plugins require an input form because they always need a way for users to send data to your app’s API to find, update, or create a new object. When building a plugin action or trigger on the Platform viaSocket, use the JSON or GUI to create the user input form for your app's API.
JSON (JavaScript Object Notation) : When building a plugin, JSON is used to define the structure and behavior of forms that users interact with. Here’s how JSON is typically utilized in this context:
Defining Input Fields: JSON is used to specify the fields that users will fill out. Each field is represented as a key-value pair with attributes that describe the field.
Specifying Field Attributes: Attributes include the field’s name, label, type, required status, and more. These attributes guide how the form will look and function within the plugin’s interface.
viaSocket GUI : The GUI functions like other form builders, creating forms within the Platform UI. Add fields to the form matching the data required by your app, using the same names as in your app’s UI.
This guide covers:
Adding Input Fields in JSON:
Define the structure and attributes of input fields using JSON.
Adding Fields through GUI:
Use the GUI to add and configure input fields seamlessly within the platform.
Adding Input Fields in JSON:
Log into the viaSocket.
Select the org in which you want to create app integration.
Go to the Developer hub and click on the ‘new plug’ button.
A json structure with default input fields will appear (as shown above), you can edit these fields according to plugin needs. In JSON editor, add in details about your input field,JSON input field attributes are:
key: A unique identifier for the field. It should be concise, without spaces, and ideally match the key for each field, used to send data in API , such as ‘username’.
Label: A name or label visible on the UI for the field, such as "Name".
type: Defines the type of input field, such as string, number, dropdown, input groups, etc. Refer to the plugin input fields documentation for more details on types.
help (optional): A longer description that appears under the field, with markdown formatting support .For example “Enter or select Account username”.
placeholder (optional): A placeholder for a field, shown inside the input field for example text. This can be used as an alternative to help text.
required : Indicates whether the field is mandatory. If the key is not provided, it defaults to false. If the field is required by the API and users must provide a value, set it to true.
Source: In case of dynamic data in the field a new JSON key is added “source”. Specifies the source of the data for the field, such as a URL or API endpoint. Discussed in advance input fields section
children: Similarly a new key required in case of dropdown,input groups which hold child elements of fields. Explained in advance input fields section
Adding Input Fields using GUI:
Log into the viaSocket.
Select the org in which you want to create app integration.
Go to the Developer hub and click on the ‘new plug’ button.
Switch to the GUI tab. Select type of field you want to add :
Add the field required and to edit the field click on setting button (Editing in GUI also reflect in JSON automatically)
Edit all attributes of field
Remember to save changes after every change in fields.