- Type a report name in the New Report Name field.
- Click Add Report or press enter.
When your connector is published, the report that the user selects will be stored in the metadata JavaScript object using the same capitalization and spaces you use to define it here. You will use the report name in the next step, when you define how the data is processed.

Enable Advanced Mode
- Click Enable Advanced Mode. You will see a modal window informing you that if you enable Advanced Mode, it will be enabled forever.
- If you would like your custom connector to have additional parameters beyond the report name, click Continue. A Parameters section will appear.

- Click Add Parameter.
- Enter a Parameter Name and Help Text. The Parameter Name will be the label for the field. The Help Text description for the new parameter will appear when the user clicks
next to the field.
- If you would like the parameter to be required for the user to run a report, check Required.
- Select a parameter Type. Each type will result in a different type of field available to the user on the web form.
- String: A text field. The user can enter a freeform text or even an HTML text.
- Integer: A number or a decimal field.
- Dropdown: A dropdown list.
- Click Add Option to add the options you wish to appear in the dropdown list. The user will be able to select one option.
- Discovery: If you need to make an API call to discover certain parameters, select this option. Discovery makes an API call to discover the options to present to the user. For example, a Facebook connector might use discovery to get a list of Facebook pages available to the user.
- Text: A text field. The user can enter a freeform text.
- Date selector: A date selector view that allows selecting specific dates.
- Click Configure to add the JavaScript code necessary to use this option. For detailed information on how to write a discovery parameter, see Write a Discovery Parameter.

metadata.parameters["<<Parameter Name>>"]
Date Selector Example
Refer to the following date selector example.
- Configure the Data processing script.

Write a Discovery Parameter
The Discovery option allows you to call an API endpoint to populate either a dropdown menu or a series of checkboxes. You must write the JavaScript code to call the endpoint and populate the appropriate discovery object. To add a Discovery parameter:
- Click Add Parameter.
- Fill in the Parameter Name and Help Text. Check Required if the parameter will be required by the connector.
- Select the Discovery type. Click Configure. The configure modal will appear.
- In the configure modal, select a Discovery Type.
- Dropdown: Select this option if you would like the user to be able to select only one option. To add an option to the dropdown discovery object, use the function
discovery.addOption("Option Value"). See the Dropdown Discovery Example. - Tree Menu: Select this option if you would like the user to be able to select multiple options. It will appear as a series of checkboxes that can be nested in a tree structure. Use the function
discovery.addNode(<<parent node name>>, <<new node name>>)to add a node. Usediscovery.addLeaf(<<parent node name>>, <<leaf name>>)to add a leaf. Use the functiondiscovery.publishTree()when you have completed adding nodes and leaves to the tree. See the Tree Menu Discovery Examples below.
- Write the JavaScript code to make the API call and populate the discovery object.
- Click Run Script to see the output of your code.
Dropdown Discovery Example
This example makes a call to the Facebook API to get all the pages controlled by this user. It inserts them as options into a discovery dropdown. This will allow a user to select just one Facebook page to run a report on. Click Run Script to see Parameter Output.
Note
Click on the parameter output to see all options.
Tree Menu Discovery Examples
The tree menu discovery option will present the user of your connector with a group of checkboxes, allowing a user to select multiple options.

discovery.addNode(parentNode, nodeName)discovery.addLeaf(parentNode, leafName)discovery.publishTree()
Note
To create a node at the root level, you must use discovery.tree as the node parameter.
Basic Discovery Tree Menu
This example makes a call to the Facebook API to get all the pages controlled by this user. To create a series of checkboxes, add each item as a leaf to the root node,discovery.tree. This will allow a user to select multiple Facebook pages to run a report on. Click Run Script to see Parameter Output.

Nested Discovery Tree Menu
You can nest checkboxes into categories by adding nodes to thediscovery.tree root. If a user checks a parent checkbox, all the checkboxes nested in it will be selected. This example nests countries in parent nodes that represent regions. To create a series of nested checkboxes, add each item as a parent node to the base node, discovery.tree. Add each leaf to their parent node. Click Run Script to see Parameter Output.
Note: The parameter output only displays top-level nodes and leaves. Click on a node to expand its leaves and nodes.

Create node using discovery.tree as the parent var northAmerica