# DynamoDBStorage.UpsertEntryAsync(string, Dictionary&lt;string, AttributeValue&gt;, Dictionary&lt;string, AttributeValue&gt;, string, Dictionary&lt;string, AttributeValue&gt;, string, Dictionary&lt;string, AttributeValue&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions.dynamodb/orleans.transactions.dynamodb.dynamodbstorage/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.transactions.dynamodb/orleans.transactions.dynamodb.dynamodbstorage/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/AWS/Shared/Storage/DynamoDBStorage.cs#L522-L558)

```csharp
public Task UpsertEntryAsync(string tableName, Dictionary<string, AttributeValue> keys, Dictionary<string, AttributeValue> fields, string conditionExpression = "", Dictionary<string, AttributeValue>? conditionValues = null, string extraExpression = "", Dictionary<string, AttributeValue>? extraExpressionValues = null)
```

Create or update an entry in a DynamoDB Table

### Parameters

- `tableName` (`string`): The name of the table to upsert an entry
- `keys` (`Dictionary<string, AttributeValue>`): The table entry keys for the entry
- `fields` (`Dictionary<string, AttributeValue>`): The fields/attributes to add or updated in the table
- `conditionExpression` (`string`): Optional conditional expression
- `conditionValues` (`Dictionary<string, AttributeValue>`): Optional field/attribute values used in the conditional expression
- `extraExpression` (`string`): Additional expression that will be added in the end of the upsert expression
- `extraExpressionValues` (`Dictionary<string, AttributeValue>`): Additional field/attribute that will be used in the extraExpression
