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.
You need to write only body of the function. To refer to the complete user object with all of the fields please check go to this link.
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.
{
"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
}