How can we help?

Smart Code Assist

Overview

Smart Code Assist is a type-ahead feature that makes it easier to write Smarty within your Data Jobs. Once you type the "{" character, a list of methods will display, and you can choose one to populate your script.

smart_code_assist.png

As of the writing of this article, this feature is only supported in Data Jobs and not Messages.

Enable Smart Code Assist

To enable this feature in your account, click on Account & Password in the upper right corner of your screen and then click Edit for Auto Complete Preference and Enable.

enable_smart_type_ahead.png

Modify configuration

You can modify the configuration by changing the JSON. Here is one example of how you could replace the method getEventRecords.

    {
        "snippet": "{\\$events.eventName = 'browse'}\n{\\$events.newerThan = ''}\n{\\$events.properties = []}\n{\\$events.limit = 2}\n{\\$events.sort = []}\n{\\$events.data = \\$utils->getEventRecords(\\$events.eventName, \\$events.newerThan, \\$events.properties, \\$events.limit, \\$events.sort)}\n\n<h2>Debug events</h2>\n{\\$utils->jsonPrettyPrint(\\$events)}\n",
        "description": "Data stored within the contact activities collection can be referenced and used within any message body.",
        "name": "$utils->getEventRecords",
        "value": "{$utils->getEventRecords}",
        "parameters": [
            {
                "name": "eventName",
                "description": "The name of the event stored in the contactactivities collection.",
                "required": "*",
                "expected": "String",
                "defaultValue": ""
            },
            {
                "name": "newerThan",
                "description": "Filters the event records returned based on the timestamp of the events.",
                "required": "",
                "expected": "String",
                "defaultValue": ""
            },
            {
                "name": "properties",
                "description": "Filters the event records returned based on a matching property value(s).",
                "required": "",
                "expected": "Array",
                "defaultValue": ""
            },
            {
                "name": "limit",
                "description": "Maximum number of records returned.",
                "required": "",
                "expected": "Integer",
                "defaultValue": ""
            },
            {
                "name": "sort",
                "description": "Sort order of the returned records.",
                "required": "",
                "expected": "Array",
                "defaultValue": ""
            }
        ]
    }

 

Video demonstration

Comments

0 comments

Article is closed for comments.