On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Snap type: | Write | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: | This Snap deletes an item or a bunch of items (based on batch size) from an existing table in AWS DynamoDB.
| |||||||||||||||||||||||||
Prerequisites: | [None] | |||||||||||||||||||||||||
Support and limitations: |
Works in Ultra Tasks. | |||||||||||||||||||||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See DynamoDB Account for information on setting up this type of account. | |||||||||||||||||||||||||
Views: |
| |||||||||||||||||||||||||
Settings | ||||||||||||||||||||||||||
Label | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |||||||||||||||||||||||||
Table name | Required. The name of the table to delete the data from. This property is suggestible, that shows the list of the tables in the database. | |||||||||||||||||||||||||
Delete condition | Specifies a condition to be used on non-key attributes for performing the delete operation.
Default value: [None] | |||||||||||||||||||||||||
Batch size
| Specifies the number of records to be deleted in a single request. Default value:1 | |||||||||||||||||||||||||
Output deleted records | Specifies whether or not to display the original records in the output view. | |||||||||||||||||||||||||
Expression attribute values |
Attribute | Type | Value |
---|---|---|
:val1 | S | Amazon DynamoDB |
Specify the placeholders for the Expression Attribute Names and/or Expression Attribute Values.
Info |
---|
DynamoDB reserves certain words and they are called reserved words. You must not use reserved words as attribute names in expressions. If you must write an expression that contains a word that conflicts with a DynamoDB reserved word, then you can define an expression attribute name to use in the place of the reserved word. For more information, see Expression Attribute Names. Similarly, you cannot use certain values as attribute values in expressions and instead must define an expression attribute name. For more information, see Expression Attribute Values. |
Click + to enter:
- Attribute: The expression attribute name. Begins with a # for names and : for values.
- Type: The attribute type. Blank for Expression Attribute Names. S for string, N for number, and so on, for Values.
- Value
- : The actual literal to be used in the delete
- condition.
Example:
Suppose, you have a table T1
with a column named Product. We want to delete a value from the Product column. Here, you cannot enter Product=value in the delete condition directly but must assign a placeholder for the value
. Hence,
we define
the Attribute :val1 of Type S and under Value, pass $values1. In the Snap Delete condition, we enter Product=:val1.
Attribute | Type | Value |
---|---|---|
: |
val1 | S |
This property enables you to execute the Snap during the Save operation so that the output view can produce the preview data.
Default value: Not selected$value1 |
Execute during preview
Similarly, if your table contains a column named UUID (a reserved word) and you want to delete a value from the UUID column, then you must assign a placeholder for the column name because you cannot use a reserved word directly in your expression. We can define the Attribute #u, leave the Type blank, and enter the value as UUID. In the Snap Delete condition, we enter #u=:val1.
Attribute | Type | Value |
---|---|---|
#u | UUID |
Multiexcerpt include macro | ||||
---|---|---|---|---|
|
Multiexcerpt include macro | ||||
---|---|---|---|---|
|
Expand | ||
---|---|---|
| ||
DynamoDB Complex types:
A values of this type contains a set of strings delimited by double quotes as follows: Pattern: [String object 1, String object 2, ........, String Object n] Example: ["Snaplogic", "San Mateo", "Pipeline"] Number Set [NS] A value of this type contains a set of numbers delimited by double quotes as follows: Pattern: [Number Obj1, Number Object2,...., Number Object n] Example: ["123", "24.56", "-35", "-21.456","0"] Binary Set [BS] A value of this type contains a set of base64-encoded binary data objects delimited by double quotes as follows: Pattern: [ Binary Object 1, Binary Object 2,...Binary Object n] Example: ["U3Vubnk=", "UmFpbnk=", "U25vd3k="] List (L): Pattern: [ object 1, object 2, ........, Object n] Example: [{"N":"3"},{"S":"-7.5"},{"B":"U3Vubnk="},{"L":[{"N":"-45.56"},{"M":{"Name":{"S":"ahmed"}}}]},{"M":{"name":{"S":"syed"}}},{"SS":["a","b"]},{"BS":["U3Vubnk="]},{"NS":["23","45"]}] Map(M): A value of this type contains a set of key- value pairs. Keys are always strings, whereas values can be of any type (String, Number, String Set, Map, List etc.,). In general, the Map object resembles a JSON array. Example: {"id":{"S":"snaplogic"}, "orgs":{"L":[{"S":"uat"}, {"S":"qa"}]}, "admins":{"L":[{"M":{"name":{"S":"a"}}}, {"M":{"name":{"S":"45"}}}]}} The pipeline using the Binary Set types for the Delete Table Item Snap:
|
Example
In this pipeline, the DynamoDB Delete Item Snap, deletes a record from the table DynamoDB_Delete1 using a delete condition by defining a placeholder.
In the upstream Mapper Snap, supply the key (737314009510) of an item to be deleted and define its placeholder value ($values1) for the attribute to be used in the delete condition.
In the DynamoDb Delete Table Item Snap, we want to delete a record from the table DynamoDB_Delete1, when the delete condition is Product = :val1, where the attribute :val1 = $Values1.
Successful execution of the pipeline displays the HTTP status code 200 in the output view:
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|