---
title: "Setting Up Parameters"
canonical: "https://wiki.yellowfinbi.com/space/user80/1541389/Setting%20Up%20Parameters"
format: markdown
---
User input parameters are created within **setupParameters****()**, by creating parameter objects and adding them to the advanced function through the **addParameter****()** method.


| **Method** | **Description** |
| --- | --- |
| addParameter(Parameter p, boolean suitableForUserPrompt) | Includes the specified parameter into the advanced function. The optional suitableForUserPrompt parameter allows users to specify this parameter value manually like a filter in the report output. |

 

 

## Parameter Methods

| **Parameter Method** | **Description** |
| --- | --- |
| setUniqueKey | Unique text key for this parameter, used to access parameter data and control dependent display. |
| setDisplayName | Text name. |
| setDescription | Text description. |
| setDataType | Type of object this parameter will return.<br>See the data type [appendix](https://yellowfin.atlassian.net/wiki/spaces/user80/pages/1542022/Advanced+Function+Appendix#AdvancedFunctionAppendix-datatypes). |
| setAcceptsFieldType | Limit the type of fields available to be selected in field selection (TYPE_FIELD DISPLAY_SELECT) parameters.<br>See the data type [appendix](https://yellowfin.atlassian.net/wiki/spaces/user80/pages/1542022/Advanced+Function+Appendix#AdvancedFunctionAppendix-datatypes). |
| setDisplayType | Display type of the input parameter.<br>See the display types [appendix](https://yellowfin.atlassian.net/wiki/spaces/user80/pages/1542022/Advanced+Function+Appendix#AdvancedFunctionAppendix-displaytypes). |
| setDefaultValue | Sets the default value for this parameter. Must be of the type specified in setDataType. |
| addOption | Add possible values to DISPLAY_SELECT, and DISPLAY_RADIO parameters. |

 

 

## Example

The following code creates two parameters. *Column* is a field selection drop-down which allows you to select any Numeric field from the report. Operator is a drop-down menu with 4 values representing basic mathematical operations.

```java
 protected void setupParameters()
  {
	Parameter p = new Parameter();
	p.setUniqueKey("FIELD_SELECTION");
	p.setDisplayName("Column");
	p.setDescription("Compare this numeric field to the selected field");
	p.setDataType(100);
	p.setAcceptsFieldType(TYPE_NUMERIC, true);
	p.setDisplayType(6);
	addParameter(p);
	
	p = new Parameter();
	p.setUniqueKey("OPERATOR");
	p.setDisplayName("Operator");
	p.setDescription("Select which Operator to apply");
	p.setDataType(2);
	p.setDisplayType(6);
	p.addOption("Add");
	p.addOption("Subtract");
	p.addOption("Divide");
	p.addOption("Multiply");
	addParameter(p);
  }


```

 

 

 

 

> Macro (section)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)