Error: dynamodb list_append returns true but does not work

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.
Other Common DynamoDB Errors (with Solutions)
- One or more parameter values were invalid: some AttributeDefinitions are not used
- DynamoDB Update Not Working
- DynamoDB attribute not empty
- dynamodb unknown error
- Unable to start DynamoDB Local process
- DynamoDB - The Security Token Included In The Request Is Invalid
- DynamoDB parameter validation failed
- dynamodb index does not exist
- DynamoDB Errors InvalidSignatureException Signature Expired
- boto3 dynamodb unable to locate credentials
- dynamodb put item not working
- dynamodb item size limit error
- DynamoDB BatchWriteItem error
- accessdeniedexception dynamodb
- DynamoDB scan does not return all items
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable