Its not clear from your question, but I believe you are calling
PutItem with only select attributes, as
PutItem is a complete overwrite of your data, you are deleting other attributes which you wish to maintain.
To overcome that, you should use
UpdateItem which will only update the attributed given in the payload. Furthermore, if the item does not exist it will act like a
PutItem and write the new item.
I assume that you are using one of the AWS IoT Core DynamoDB actions in a rule. Both actions use
PutItem hence the behavior you observe. As Leeroy mentions,
UpdateItem should be used, but you will need to pass the message to a Lambda function first.
An alternative is to use a
WHERE clause in the rule to only execute the rule if the string is not empty.
Dynamodb is not storing all the received IoT core dataasked 3 days ago
AWS IoT Data Type Errorasked 9 months ago
Errors at dimensions (empty value) in Timestream from an IoT RuleAccepted Answerasked a year ago
Writing IOT Data to S3asked 10 months ago
AWS IoT Rule to send MQTT message to DynamoDB not workingAccepted Answerasked 7 months ago
dynamodb fill empty cells with previous valueasked 13 days ago
Not able to update the DynamoDB table from the IoT device (node-red) MQTTasked 2 years ago
AWS IoT DynamoDB rule not able to read value SELECTed from topic() functionAccepted Answerasked 3 years ago
Duplicate MQTT messages being received at DynamoDBAccepted Answerasked 6 months ago
Problem with Ingestion data from IoT Core (MQTT) to AWS SiteWiseasked a year ago