DynamoDB Request

The DynamoDB Request allows you to execute multiple operations on DynamoDB-compatible data sources.

You can use UI Bakery variables to compose table names, item keys, and filter expressions. Here's an example of a dynamic update expression:

{
  "TableName": "users",
    "Key": {
    "Id": {
      "N": "101"
    }
  },
  "UpdateExpression": "SET Title = :title",
    "ExpressionAttributeValues": {
    ":title": {
      "S": {{ui.input.value}}
    }
  }
}

DynamoDB command examples

query

query is used to search for or filter the items in your DynamoDB collection. Select query from the list and specify its parameters:

{
  TableName: 'users',
  KeyConditionExpression: "Id = :v1",
  ExpressionAttributeValues: {
    ':v1': {"N": '101'},
  }
}

scan

scan is used to retrieve all of the items or just some of them from your DynamoDB collection. Select scan from the list and specify the query parameters:

{
	TableName: 'users',
}

getItem

The getItem operation returns a set of Attributes for an item that matches the primary key. Select getItem from the list and specify the query parameters:

{
  TableName: 'users',
  Key: {
    Id: {
      N: '101'
    }
  }
}

putItem

To add a new item to your collection, use putItem. Select putItem from the list and specify the query parameters:

{
  "TableName": "users",
  "Item": {
    "Id": {
        "N": "110"
    },
    "username": {
        "S": "JohnDoe"
    },
    "email": {
        "S": "[email protected]"
    },
    "age": {
        "N": "30"
    },
    "gender": {
        "S": "male"
    }
  }
}

updateItem

updateItem edits an existing item's attributes or adds a new item to the table if it doesn't exist yet. You can put, delete, or add attribute values. Select updateItem from the list and specify the query parameters:

{
  "TableName": "users",
  "Key": {
    "Id": {
      "N": "101"
    }
  },
  "UpdateExpression": "SET Title = :title",
  "ExpressionAttributeValues": {
    ":title": {
      "S": {{ui.input.value}}
    }
  }
}

deleteItem

To delete an item from the collection, use deleteItem. Select deleteItem from the list and specify the query parameters:

{
  "TableName": "users",
  "Key": {
    "Id": {
      "N": "101"
    }
  }

batchWriteItem

To put or delete multiple items in one or more collections, use batchWriteItem. Select batchWriteItem from the list and specify the query parameters:

{
  "RequestItems": {
    "users": [
      {
        "PutRequest": {
          "Item": {
            "Id": {
              "N": "110"
            },
            "username": {
              "S": "JohnDoe"
            },
            "email": {
              "S": "[email protected]"
            },
            "age": {
              "N": "30"
            },
            "gender": {
              "S": "male"
            }
          }
        }
      }
    ]
  }
}

For more details about DynamoDB queries, please refer to DynamoDB docs.

Last updated

Was this helpful?