title: How to insert empty string in DynamoDB using the output of a Lambda in Step Functions?
body: <p>I'm trying to save the output of a Lambda which calls Lex to DynamoDB using Step Functions.</p>
  
  <p>The <code>intentName</code> in a Lex response is sometimes <strong>null</strong> (unknown). The problem is that in the state (task) that saves the response to DynamoDB, because of this empty string I get an error from DynamoDB.</p>
  
  <p>Is there any workaround, maybe using JsonPath or the state machine diagram of the Step Function, in order to insert <strong>null</strong> or maybe no insert that specific property in DynamoDB?</p>
  
  <p>Here is the JSON for the state machine:</p>
  
  <pre><code>{
    "StartAt": "ProcessLex",
    "States": {
      "ProcessLex": {
        "Type": "Task",
        "Resource": "arn:aws:lambda:&lt;Region&gt;:&lt;Account Id&gt;:function:getIntent",
        "ResultPath": "$.lexResult",
        "Next": "ChoiceIfIntent"
      },
      "SaveToDynamo": {
        "Type": "Task",
        "Resource": "arn:aws:states:::dynamodb:putItem",
        "Parameters": {
          "TableName": "MyTable",
          "Item": {
            "dateTime": {
              "S.$": "$.dateTime"
            },
            "intentName": {
              "S.$": "$.lexResult.intentName"
            },
            "analysis": {
              "M.$": "$.lexResult.sentimentResponse"
            }
          }
        },
        "End": true
      },
      "Comprehend": {
        "Comment": "To be implemented later",
        "Type": "Pass",
        "End": true
      },
      "ChoiceIfIntent": {
        "Type": "Choice",
        "Choices": [
          {
  
              "Variable": "$.lexResult.intentName",
              "StringGreaterThanEquals": "",
  
            "Next": "SaveToDynamo"
          }        
        ],
          "Default": "Comprehend"
      }
    }
  }
  </code></pre>