IntelliTicks
  • Introduction
  • Getting Started
    • Overview
    • Build your first playbook
      • Start with Pre-build Templates
      • Start from scratch
  • Installation
    • IntelliTicks Plugin Script
    • Plugin Installation
  • Facebook Messenger Bot
    • Getting Started
      • Connect Facebook Page
      • Link Playbook to Messenger
    • Testing FB Messenger Bot
  • WhatsApp Bot
    • Benefits of WhatsApp Chatbots
    • Getting Started
    • FAQs
  • AI Builder
    • Playbooks
    • Nodes
      • Add and Send Data
        • Text
        • Image
        • Links
        • Youtube
        • Gallery
        • Dynamic Node
      • Collect User Data
        • Quick Reply
        • Form
        • Datepicker
        • Web View
        • Payment
        • Rating
        • Slider
        • Ask Question
        • Mutli Selection Reply
        • Quick Reply (with branches)
      • Redirect Users
        • URL redirect
        • Conditional branching
        • Go to Playbook
        • Jump to node
      • Export & Import
        • JSON API
      • Connect Users To A Human
        • Notify Agent
        • End Automation
      • Additional
        • Wait
        • Client Javascript
        • Actions
    • Actions
    • FAQ Training
    • Keyword Training
    • Advanced
      • Advanced Actions
  • Flash Responses
    • Flash Response
    • Create Flash Response
    • Using Flash Response
  • Customizing Platform
    • Widget
      • Theme Customization
      • Chat Widget Texts in Local Language
      • Adding Start Over button
      • URL Rules
      • Advanced Customization
        • How to Easily Add Custom CSS to Chat Widget
    • Chat icon/Bot Profile Photo
    • Different chatbot on each URLs
  • Integrations
    • WordPress Integration
    • Shopify Integration
    • Shopify Installation via Private Apps
    • Google Analytics
    • Magento Integration (1.x)
    • Magento Integration (2.x)
    • LeadSquared Integration
    • Marketo Integration
    • Salesforce Integration
    • Zapier Integration
      • Data Available in Zapier
    • Zoho CRM Integration
    • Wix Integration
    • Custom/in-house CRM integration
  • How to
    • Change the Default Playbook
    • Schedule meetings on calendar
      • How to integrate calendly for meetings
      • How to integrate Acquity for meetings
      • How to Integrate YouCanBook for meetings
    • Block a User
    • Delete a User
    • Hide trigger message from website
    • How to show chatbot in right middle of website
    • Start chatbot on a button click
    • Create chatbot landing page
    • Customize Landing Page Link
    • Enable Notifications on browser
    • Popup bot on Facebook page automatically
    • How to send data to chatbot via Javascript
  • Growth Hacks
    • Facebook Retargeting
    • Messenger Ads to chatbot
  • Troubleshooting
    • Messenger Bot is not working as expected
    • How do I remove the Messenger app in Shopify?
    • Push Notification Issues
  • Partnerships
    • White-labeled Chat Platform
    • Affiliate Partnership
  • Miscellaneous
    • Languages Supported
Powered by GitBook
On this page

Was this helpful?

  1. AI Builder
  2. Nodes
  3. Add and Send Data

Dynamic Node

PreviousGalleryNextCollect User Data

Last updated 4 years ago

Was this helpful?

The Dynamic Node is used to create dynamic nodes based on some logic written in JavaScript.

This is an advanced node. You need have the knowledge of Javascript to use this node.

You need to write body of a function which takes user as parameter and returns list of nodes or actions as a response. Below is the format of function.

function(user) {
    //your logic goes here
    return {
        nodes:[]
    };
}

You need to write only body of the function. To refer to the complete user object with all of the fields .

the function should return nodes in required JSON format. Below is the format of json for each type of nodes. Please note that all nodes are not supported here. Below are nodes which are supported.

Add and send data

{
      "node_type": "TEXT",
      "txt": "<desired text>",
}
{
  "node_type": "IMAGE",
  "txt": <null or String>,
  "img": "<url of image",
}
{
  "node_type": "LINKS",
  "txt": "<text message before links>",
  "links": [//array of links as per the requirement. At least one obect is required in the array
    {
      "link_type": "EMAIL",//To show email link
      "open_in_new_tab": true,
      "title": "<text of button such as Email us>",
      "email": "<email>"
    },
    {
      "link_type": "PHONE",//To show click to call button
      "open_in_new_tab": true,
      "title": "<text of button such as Call us>",
      "phone": "<phone number with ISD code"
    },
    {
      "link_type": "WHATSAPP",//To show click to whatsapp
      "open_in_new_tab": true,
      "title": "<text of button such as Whatsapp us>",
      "phone": "<phone number with ISD code"
    },
    {
      "link_type": "LINK",//To show another link
      "open_in_new_tab": true,//where you would like to open link on new tab on click
      "title": "<text of button such as click here",
      "url": "<full URL starting with https:// or http://"
    },
    {
      "link_type": "PLAYBOOK",//To show another link
      "open_in_new_tab": false,
      "title": "<text of button such as click here",
      "playbook": "5d78c366380d7b0c67bb6230"//playbook id
    }
  ]
}
{
  "node_type": "YOUTUBE",
  "url": "<URL of youtube video such as ",
  "autoplay": true,//whether you would like to autoplay video
  "txt": "<desired text before the video>",
}
{
  "node_type": "CAROUSEL",
  "elements": [// array of card templates, at least one is required
    {
      "title": "<card title>",
      "subtitle": "<card subtitle>",
      "image_url": "<card img url>",
      "buttons": [// array of links node, up to three
        {
          "link_type": "EMAIL",//To show email link
          "open_in_new_tab": true,
          "title": "<text of button such as Email us>",
          "email": "<email>"
        },
        {
          "link_type": "PHONE",//To show click to call button
          "open_in_new_tab": true,
          "title": "<text of button such as Call us>",
          "phone": "<phone number with ISD code"
        },
        {
          "link_type": "WHATSAPP",//To show click to whatsapp
          "open_in_new_tab": true,
          "title": "<text of button such as Whatsapp us>",
          "phone": "<phone number with ISD code"
        },
        {
          "link_type": "LINK",//To show another link
          "open_in_new_tab": true,//where you would like to open link on new tab on click
          "title": "<text of button such as click here",
          "url": "<full URL starting with https:// or http://"
        },
        {
          "link_type": "PLAYBOOK",//To show another link
          "open_in_new_tab": false,
          "title": "<text of button such as click here",
          "actions":[],//actions to run when this button is selected. can be found on https://docs.intelliticks.com/ai-builder/nodes/additional/actions (see actions(after first json), not the action node json)
          "playbook": "5d78c366380d7b0c67bb6230"//playbook id
        }
      ]
    }
  ]
}
{
  "node_type": "GO_TO_PLAYBOOK",
  "playbook_id": "5d78c366380d7b0c67bb6230"//plabook id
}

Collect User Data

{
  "node_type": "QUICK_REPLY",
  "actions_on_response": [],
  "text": "<text before quick reply>",
  "responses": [//array of responses
    {
      "txt": "<option 1>"
    },
    {
      "txt": "<option 2>"
    },
    {
      "txt": "<option 3>"
    }
  ],
  "option_display_mode": "",// one of "HORIZONTAL" "VERTICAL" "DROPDOWN"
  "placeholder": "<placeholder in case of dropdown such as Type to search..>"
}
{
  "node_type": "QUESTION_FORM",
  "questions": [
    {
      "text": "<label for the field>",
      "failMsg": "<Error msg when validation fails>",
      "input_type": "NAME",//used when asking for name
      "actions": [//array of actions to run after getting response
        {
          "type": "SET_NAME"//this action sets name to user's profile
        }
      ],
      "skip": false//whether user can skip this field
    },
    {
      "text": "<label for the field>",
      "failMsg": "<Error msg when validation fails>",
      "input_type": "REGEX",//used to take single line input with regex based validation
      "actions": [//array of actions to run after getting response
      ],
      "skip": false,//whether user can skip this field
      "regex_pattern": "^[a-zA-Z ]*$"//regex to validat the input
    },
    {
      "text": "<label for the field>",
      "failMsg": "<Error msg when email validation fails>",
      "input_type": "EMAIL",//used to take email as input
      "actions": [//array of actions to run after getting response
        {
          "type": "SET_EMAIL"//action to set email to user's profile
        }
      ]
    },
    {
      "text": "<label for the field>",
      "failMsg": "<Error msg when email validation fails>",
      "input_type": "PHONE",//used to take phone as input
      "actions": [//array of actions to run after getting response
        {
          "type": "SET_PHONE"//action to set phone to user's profile
        }
      ]
    },
    {
      "text": "<label for the field>",
      "failMsg": "<Error msg when email validation fails>",
      "input_type": "TEXT",//used to take input using multi-line text area
      "actions": []//array of actions to run after getting response
    }
  ],
  "txt_b4_questions": "<message before the form or null>",
  "txt_after_questions": "<message after the form or null>",
}
{
  "node_type": "DATEPICKER",
  "actions_on_response": [],
  "text": "<text before asking date",
  "allow_old_dates": true//whether to allow selecting past dates
}
{
  "node_type": "RATING",
  "txt": "<message before rating>"
}
{
  "node_type": "SLIDER",
  "actions_on_response": [],
  "txt": "<text before slider>",
  "unit": "<units to show for slider input such as kg, years etc.",
  "sliderType": "RANGE",//SINGLE(for single input) RANGE(for selecting range)
  "defaultMin": 30,//default value shown(default min value in case of range slider)
  "defaultMax": 60,//default max value in case of range slider.
  "min": 10,//min allowed value
  "max": 300,//max allowed value
  "step": 1,//interval between each value user can select.
  "title": "<title to show above the slider>"
}
{
  "node_type": "TEXT_RESPONSE",
  "actions_on_response": [],
  "text": "<text for the question>"
}
{
  "node_type": "MULTI_SELECTION_REPLY",
  "text": "wegewgew",
  "skip": false,//whether user can skip without selecting anything
  "responses": [
    {
      "txt": "gewg"
    },
    {
      "txt": "ggg"
    }
  ]
}
please check go to this link