dynobase-icon
Dynobase

Error: ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An AttributeValue may not contain an empty string

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

The message An AttributeValue may not contain an empty string often comes from old validation rules or an empty key value. Current DynamoDB accepts empty String and Binary values for non-key attributes; table and index key values cannot be empty, and sets cannot be empty.

  1. Identify which placeholder contains the empty value and whether it is used as a table or index key. Supply a real key value rather than converting it to null.
  2. If the empty string is an ordinary attribute, check for an outdated emulator, SDK wrapper or application validator. The service no longer rejects every empty string.
  3. Decide whether an empty string, a missing attribute and NULL mean different things in your data model before enabling conversion.

The v3 document client can preserve an empty non-key string:

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

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

await db.send(new PutCommand({
  TableName: "Notes",
  Item: { pk: "NOTE#1", body: "" },
}));

If your application deliberately stores empty values as NULL, configure marshallOptions: { convertEmptyValues: true } in DynamoDBDocumentClient.from(client, options). This changes the stored representation; it does not make a null primary key valid. For an optional GSI key, omit the attribute when the item should not appear in that index.

See attribute types 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.