Functions supported for API return parameters

Updated at:

This topic describes the functions that are supported for API return parameters.

Background information

In DataService Studio, when you create an API using the codeless UI, you can configure functions for the return parameters of specific data source types, such as RDS and PostgreSQL. You can use these functions to perform operations such as aggregation, finding extreme values, case conversion, calculating string lengths, and string truncation.

Function list

Function name

Description

Usage

AVG

Calculates the average value.

AVG(<field>)

COUNT

Calculates the total count.

COUNT(<field>)

MAX

Finds the maximum value.

MAX(<field>)

MIN

Finds the minimum value.

MIN(<field>)

SUM

Calculates the sum.

SUM(<field>)

VARIANCE

Calculates the variance.

VARIANCE

STDDEV

Calculates the standard deviation.

STDDEV(<field>)

DAY

Gets the day from a date.

DAY(<field>)

MONTH

Gets the month from a date.

MONTH(<field>)

YEAR

Gets the year from a date.

YEAR(<field>)

WEEKDAY

Gets the day of the week.

WEEKDAY(<field>)

CURRENT

Gets the current time.

CURRENT(<field>)

LOWER

Converts a string to lowercase.

LOWER(<field>)

UPPER

Converts a string to uppercase.

UPPER(<field>)

REPLACE

Replaces a substring.

REPLACE(<field>, <search_text>, <replacement_text>)

SUBSTR

String truncation

SUBSTR(<field>, <start_position>, <length>)

LPAD

Pads the left side of a string.

LPAD(<field>, <length>, <pad_text>)

RPAD

Pads the right side of a string.

RPAD(<field>, <length>, <pad_text>)

LENGTH

Calculates the length of a string.

LENGTH(<field>)