title: DynamoDB multiple filter conditions, gives error - buildTree error: unset parameter: ConditionBuilder
body: <p>I am building REST APIs, using Lambda and DynamoDB in GO.</p>
  
  <p>I need to query the data based on multiple filters.</p>
  
  <p>The number of filters can be varying based on the number of query parameters user has provided, while calling the REST API.</p>
  
  <p>As per the below post, I had developed the code to add multiple conditions.</p>
  
  <p><a href="https://stackoverflow.com/questions/53073212/aws-sdk-for-go-dynamodb-add-multiple-conditions-to-filterexpression">AWS SDK for Go - DynamoDb - Add multiple conditions to FilterExpression</a></p>
  
  <p>But when I invoke the function, I get below error, in the logs.- </p>
  
  <blockquote>
    <p>buildTree error: unset parameter: ConditionBuilder</p>
  </blockquote>
  
  <p>The Filter expression is not applied and the scan returns all the results.</p>
  
  <p>Here is the code snippet.</p>
  
  <pre><code>for queryParam, queryParamValue := range searchParams {
          fmt.Println("queryParam:", queryParam, "=&gt;", "queryParamValue:", queryParamValue)
          if queryParam == “param1” {
              param1Condition = expression.Name(“param1”).Equal(expression.Value(queryParamValue))
          }
  
          if queryParam == “param2” {
              param2Condition = expression.Name(“param2”).Equal(expression.Value(queryParamValue))
          }   
      }
  
  
  sampleExpr, errSample := expression.NewBuilder().
          WithCondition(param1Condition.Or(param2Condition)).
          Build()
      if errSample != nil {
          fmt.Println("Error in building Sample Expr ", errSample)
      } else {
          fmt.Println("sampleExpr ", sampleExpr)
      }
  
      input := &amp;dynamodb.ScanInput{
          ExpressionAttributeNames:  sampleExpr.Names(),
          ExpressionAttributeValues: sampleExpr.Values(),
          FilterExpression:          sampleExpr.Filter(),
          TableName:                 aws.String(deviceInfotable),
      }
  </code></pre>
  
  <p>But if I create the expression in different way, it works.</p>
  
  <pre><code>filt := expression.Name("param1").Equal(expression.Value("valu1")).Or(expression.Name("param2").Equal(expression.Value("value2")))
  </code></pre>