[Download] | [Documentation Home] | [Release Note]

Default Values

Introduction

When defining a data service, a user may have an requirement, that even if a user has not entered a specific parameter value in a request, a default value should be automatically added to the query. This can be done in WSO2 Data Services Server using the default values feature that is found when defining a query.

Setting the Default Value

Figure 1 shows the step in setting a default value for an input-mapping in a query.



Figure 1: Setting a default value to a field.

Referring to Internal Property Values using Default Values

WSO2 Data Services Server defines special system variables, that can be used as a default value. At the moment, it only provides a variable for retreiving the username of the current user who is authenticated in a secured data service. This variable can be accessed by using the following syntax.

Demo

For a demonstration of the usage of default values, refer to the default values demo in the samples.