archive_How to create plugins action
SAMPLE JSON :
"inputFields": [
{
"key": "inputField_unique_name",
"label": "Campaign Selection",
"type": "string",
“required” : true,
"help": "Select a campaign from the list"
},
{
"key": "Create_Prospect",
"type": "dropdown",
"label": "Create Prospect",
"required": false,
"children": [
{
"label": "Email",
"sample": "string",
"value": “option 1”
},
{
"label": "Email",
"sample": "string",
"value": “option 1”
}
]
}
]
Description
"inputFields": This is like a list of different things you can fill out.
{
"key": "inputField_unique_name",
"label": "Campaign Selection",
"type": "string",
“required” : true,
"help": "Select a campaign from the list"
},
"key": Each thing in the list has a special name. For example, it could be "Campaign Selection" or "Create Prospect."
"label": This is the name you see next to the thing you fill out. For example, it could be "Campaign Selection" or "Create Prospect."
"type": It tells you what kind of thing it is. It could be a dropdown (like a menu), a simple text field (where you type), or a group of things.
"help": This is like a little message that helps you understand what to do. For instance, it might say "Select a campaign from the list" or "Enter the prospect's email address."
"required" (only for groups of things): It says whether you must fill out everything in the group. If it's true, you have to do it. If it's false, you can skip some.
“children” ( for static contents) The "children" key is used to define a list of options for a static dropdown or ‘input groups’ within the "Create Prospect" input group. Each option is represented as a JSON object within this array.
"source" ( for dynamic contents, only for dropdown type or ‘input groups’ ): This is a special code that gets the list of options for the dropdown or ‘input groups’. It's like the code that makes a menu in a restaurant.
You can get dynamic contents through Apis, which return the same format as array of json (0bject)
Perform Api
"Perform API”: This is like the magic behind the scenes. It takes the information you've filled out in the JSON fields, and it does something special with it.
Types In Plugin:
string
{
"key": "inputField_unique_name",
"label": "Campaign Selection",
"type": "string",
“required” : true,
"help": "Select a campaign from the list"
},
dropdown
Static Dropdown
Json:
{
"key": "Create_Prospect",
"type": "dropdown",
"label": "Create Prospect",
"required": false,
"children": [
{
"label": "Email",
"sample": "string",
"value": "option 1"
},
{
"label": "Phone",
"sample": "string",
"value": "option 2"
}
]
}
Dynamic Dropdown
Json:
{
"key": "Create_Prospect",
"type": "dropdown",
"label": "Create Prospect",
"required": false,
"source": “ API CALLING, which return array of json “
}
"source": "Code to fetch campaign options in JS“ // Code to retrieve and populate the dropdown options - return in array of objects
**This should have a ‘return’ statement**
3. input groups
Static input groups
Json:
{
"key": "Create_Prospect",
"type": "input groups",
"label": "Create Prospect",
"required": false,
"children": [
{
"label": "Email",
"sample": "string",
"value": "option 1"
},
{
"label": "Phone",
"sample": "string",
"value": "option 2"
}
]
}
Dynamic Dropdown
Json:
{
"key": "Create_Prospect",
"type": "input groups",
"label": "Create Prospect",
"required": false,
"source": “ API CALLING, which return array of json “
}
"source": "Code to fetch campaign options in JS“ // Code to retrieve and populate the dropdown options - return in array of objects
**This should have a ‘return’ statement**
Note: “source” can contains only stringified json