Skip to content

Add Last

Description

This operation adds new values to the very end of a list.

Method

PUT

Endpoint URL

Important

Make sure to replace xxxx in the domain name in the request specification below to the one assigned to your application.

https://xxxx.backendless.app/api/hive/[hive-name]/list/[key]/add-last

where:

Argument                Description
[hive-name] Name of a hive where the operation is performed.
[key] Key name identifying a list.

Request Headers

Content-Type:application/json

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.

Request Body

The request body must be a JSON array of values. Each individual value must of a valid JSON type. For example:

["value1", true, 17, 1.99, ...]

Response Body

The number of values in the list after the new values are saved.

Example

The example below adds the ""Apple"" and ""Orange"" values to the very end of the fruits list.

curl --location --request PUT "https://xxxx.backendless.app/api/hive/groceryStore/list/fruits/add-last" \--header 'Content-Type: application/json' \--data-raw '["Apple", "Orange"]'

where:

Argument                Description
groceryStore Name of a hive where the operation is performed.
fruits Key name identifying a list.

Codeless Reference
list_api_add_last

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a list.
items A list of new items to add to the list.
position: last Instructs Hive to add the new values at the end of the list.

Returns the number of values in the list after the new values are saved.

Consider the following List storage:

list_api_example_add_first_2

The example below adds "Apple" and "Orange" to the end of the "fruits" list:
list_api_example_add_last

The list will look as shown below after the Codeless logic runs:

list_api_example_add_last_2