RIGHT

RIGHT returns the rightmost segment of a string as specified by a segment position argument.

Function category: Text

To get characters from the left side of a string, use LEFT

Unlike LEFT, the segment position argument for RIGHT is counted from right to left, as opposed to left to right.

Syntax

RIGHT(arg1, arg2)

Arguments

Descriptions

arg1

String to be segmented.

arg2

Optional. Point from the right at which to segment the strings (defaults to 1)

Examples

Let's say we're given a response with an id object.

{
"data":{
"ids":{
"id_1": "1anb4amca051"
}
}
}

If we are only interested in the last 5 digits of the id value, we can use the following function.

# Get the digits as specified by arg2
RIGHT(data.ids.id_1, 5)
# Returns ca051