---
title: Examples
slug: template-js/modify-response-example
docTags: 
createdAt: 2023-06-15T19:23:51.000Z
---

# Modify Response

Below are some common uses of modifying the query response. You can find guides for more elaborate customizations within the **How-To** section of the Template JS documentation.

Please review : The Modify Response [Overview](docId\:k-USIa-fv-m380BqcAw7P) for complete details on the syntax used for modifying the incoming query response.



## Modify Datapoints

Product datapoints can be modified before it goes into templating.

```javascript
klevu.modifyResponse("landing", function(data, scope){
  klevu.each(data.template.query.productList.result, function(indx, product)
  {
      if (indx === 5) {
         product.salePrice = '999.00';
      }
  });
});
```



## Additional Datapoints

Custom datapoints can be added to the product response before it goes into templating. These additional points are commonly used in display or other rendering logic.

```javascript
klevu.modifyResponse("landing", function(data, scope){
  klevu.each(data.template.query.productList.result, function(indx, product)
  {
      if (indx === 5) {
         product.myFlag = true;
      }
  });
});
```

