dynobase-icon
Dynobase

Error: DynamoDB attribute not empty

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

An attribute being empty is not universally invalid in DynamoDB. Empty non-key strings and binary values, empty lists, and empty maps are allowed. Empty sets and empty table or index key values are not. Identify the attribute’s role and type before changing it.

To require a nonempty string in a condition or filter, combine existence, type, and size checks:

const params = {
  TableName: "Orders",
  Key: { id: "123" },
  UpdateExpression: "SET #status = :ready",
  ConditionExpression: "attribute_exists(#note) AND attribute_type(#note, :stringType) AND size(#note) > :zero",
  ExpressionAttributeNames: { "#note": "note", "#status": "status" },
  ExpressionAttributeValues: { ":stringType": "S", ":zero": 0, ":ready": "READY" }
};
// Pass params to SDK v3 UpdateCommand with DynamoDBDocumentClient.

The condition examines the current item, not the value being assigned by the update. An absent field, a NULL field, and an empty string are distinct states. Whitespace-only strings have a nonzero size; normalize them in the application if they should count as empty. Do not introduce fake values solely to satisfy a key or set constraint.

See empty value rules 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.