# Change Button Based on Record Value

> In this example, we are doing three comparisons using the {{#is}} helper to check if the status field (field_35) is Contact, Lead, or Won. The HTML…

Source: https://tadabase.com/docs/snippets/change-button-based-on-record-value  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

![Screenshot for “Change Button Based on Record Value”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665092238600.png)

In this example, we are doing three comparisons using the {{#is}} helper to check if the status field (field_35) is Contact, Lead, or Won. The HTML within the {{#is}} helper outputs only when the comparison is TRUE. You’ll notice that each line of HTML contains a different btn-class.

**One Easy Step**

**Add a custom component in list format to your page. Add the following code to the template in the component or customize your own using the Datatables in our library.**

> **Note:** If you wish to customize this in <th></th>, You will label your headers in <td></td> you will choose the fields you wish to include. You will also need to change the comparison values to the values you will be comparing.

```
<table id="example" class="display" style="width:100%">
    <thead>
        <tr>
            <th>Customer Name</th>
            <th>Email</th>
            <th>Status</th>
            <th>Details</th>
        </tr>
    </thead>
    <tbody>
        {{#each records}}
            <tr>
                <td>{{field_31}}</td>
                <td>{{field_32}}</td>
                <td>{{field_35}}</td>
                {{#is field_35 "Won"}}
                <td><a class="btn btn-success" href="{{tb_link this tb-id="1"}}">Nice Job!</a></td>
                {{/is}}
                {{#is field_35 "Lead"}}
                <td><a class="btn btn-danger" href="{{tb_link this tb-id="1"}}">Almost There!</a></td>
                {{/is}}
                {{#is field_35 "Contact"}}
                <td><a class="btn btn-primary" href="{{tb_link this tb-id="1"}}">Looks Promising!</a></td>
                {{/is}}
            </tr>
        {{/each}}
    </tbody>
</table>
```

![Screenshot for “Change Button Based on Record Value”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665090922628.png)

![Screenshot for “Change Button Based on Record Value”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665091770592.png)

**Original Community Post:**

[Change button type based on record value - Community Discussions / How Do I - Tadabase Community](https://community.tadabase.io/t/change-button-type-based-on-record-value/1630/2)
