dynobase-icon
Dynobase

Error: dynamodb list_append returns true but does not work

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

list_append is evaluated inside a DynamoDB update expression and does not return true or false to your application. A Boolean result comes from a wrapper. An append of an empty list can succeed without changing the stored list.

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, UpdateCommand } from "@aws-sdk/lib-dynamodb";

const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));

const { Attributes } = await db.send(new UpdateCommand({
  TableName: "Groups",
  Key: { pk: "group-1" },
  UpdateExpression: "SET #users = list_append(if_not_exists(#users, :empty), :new)",
  ExpressionAttributeNames: { "#users": "users" },
  ExpressionAttributeValues: { ":empty": [], ":new": [{ name: "Jake" }] },
  ReturnValues: "ALL_NEW",
}));
console.log(Attributes?.users);

Pass the new user inside a list, even when appending one element. The first argument goes before the second, so reverse them to prepend. Verify the complete key, table and endpoint if the result appears elsewhere. Inspect the returned Attributes rather than trusting a wrapper's Boolean flag.

Appending is not idempotent: replaying a successful append adds the element again. If retries after an ambiguous timeout matter, use a conditional version check or an application-specific idempotency design.

See item updates and AWS documentation.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.