capabilities.work

Conditional Update of an Existing Item

A 2-step recipe with Amazon DynamoDB. We can help you get access.

Recipe · 2 steps

Conditional Update of an Existing Item

Update an item only when a prior read confirms it exists.

  1. Read the target item by its primary key to confirm it exists.
  2. Apply the update expression to the item that the prior read confirmed exists, returning the new attribute values.
What you'll need to have ready
  • tableName: The name of the table containing the item.
  • key: The primary key of the item, as a map of attribute name to AttributeValue.
  • updateExpression: The update expression to apply (e.g. "SET
  • expressionAttributeNames: Optional substitution tokens for attribute names.
  • expressionAttributeValues: Values substituted into the update expression.
For your developer

Arazzo workflow amazon-dynamodb:conditional-update-item, 2 operations: GetItem → UpdateItem. Specs on APIs.io.