Param
Parameters are used to pass values to commands.
| XML | |
|---|---|
Attributes
Required
name- name of the parameter
Optional
label- display nametitle- placeholder textscope- applies the parameter only to the matching command; comma-separated values are allowed- element value (text) - default value
null- equals null- an empty value sent by the client equals null
- server-side variables
[[variable]]are available; see server-side variables; an unresolved[[variable]]equals null
lg- show/hide on desktopsm- show/hide on mobiletype- UI type / DB type; default istextselect- dropdown; the list is loaded from the command with the same name as the parameter (opts="pscope"); the first two columns are the key and the displayed valuemultiselect- dropdown with multiple selection; the list is loaded the same way as forselectsearch- wide search box, minimum 3 charactersnumberdecimalmoneynumericsmallmoney/ decimalintbiginttinyintsmallintinteger/ bigintuniqueidentifieruuid/ uniqueidentifierdate/ datedatetimedatetime2smalldatetime/ datetimefloat/ floatxml/ xmlansi/ varchartextpasswordhiddencolorand any other type / nvarcharcheckbox- Yes/No buttons in the UI; value 1/0/null- any HTML input type can be used; see https://www.w3schools.com/tags/att_input_type.asp
- a value that does not match a numeric, date or uniqueidentifier type stops the command with
Parameter {name} not valid ...
optsserver- server-side parameter; useful for predefined values that cannot be overwritten by the userjson-xml-root- takes the property and converts it to XML; supports arrays: an array is forced and elements are wrapped in a row; requires a JSON body (POST)json-xml- takes the property and converts it to XML; throws an error if the JSON is an array; usejson-xml-rootfor arrays or send JSON with a root element; requires a JSON body (POST)body-xml-root- takes the body as is and converts it to XML; supports arrays: an array is forced and elements are wrapped in a rowbody-json- takes the entire body as JSON and sends it as JSON; supports JSON objects and arraysreq- the parameter is required
Note
Deprecated aliases: json-xml-body → body-xml-root, json-body → body-json.
Note
Using the correct data type is important for proper data validation.
Parameter processing order
When the same parameter comes from several sources, the first one wins:
- Server-side parameters (cannot be overwritten by the user)
- Query string
- Body parameters
When the SRS defines parameters, only those parameters are filled from the request. When it defines none, or only server-side parameters, every query string and body value is passed to the commands as a parameter.
Using parameters is safe from SQL injection and is recommended. To learn more, see OWASP SQL Injection.
Example of a server-side parameter:
| XML | |
|---|---|
Examples
Parameter UI
| XML | |
|---|---|