# Number Count in Badge With Extra Filters

> This is a solution to display a count of the total number of records connected to the logged-in user’s company inside a badge on the menu component.

Source: https://tadabase.com/docs/snippets/number-count-in-badge-with-extra-filters  
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 “Number Count in Badge With Extra Filters”](https://community.tadabase.io/uploads/default/original/1X/c500a7c9b6cfe6bb005d9ac26ac03c0d6615fd99.png)

This is a solution to display a count of the total number of records connected to the logged-in user’s company inside a badge on the menu component.

**Step 1**

**Configure a new pipe with the following settings.**

**Overview**

- GET - [https://api.tadabase.io/api/v1/data-tables/](https://api.tadabase.io/api/v1/data-tables/)**TABLE_ID** /records?filters[items][0][field_id]= **field_XX** &filters[items][0][operator]=is&filters[items][0][val]={loggedInUsersCompany}

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665722093348.png)

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665722589196.png)

**Parameters**

- Name: Logged In Users Company
- Slug: loggedInUsersCompany

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665723218150.png)

**Headers**

- X-Tadabase-App-id
- X-Tadabase-App-Key
- X-Tadabase-App-Secret

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665723679942.png)

**Response**

- JSON - total_items - Total Items

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665724077594.png)

**Step 2**

**Add an HTML component to your layout; we will configure the pipe inside, as seen in the image below.**

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665725057350.png)

**Next, add the following source code <> to your component.**

```
<p><span id="html-component-variable">{YOUR_PIPE_VALUE}</span></p>
```

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665725240186.png)

> **Note:** Remember to insert your pipe value into {YOUR_PIPE_VALUE}. Find your pipe's value in the image below.

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665775503220.png)

**Step 3**

**We will now add the following source code to your menu component for a custom menu item.**

```
Projects <span id="menu-badge" class="badge"></span>
```

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665775935135.png)

**Step 4**

**Add the following code to the JavaScript tab of the Layout (This appends the text in the HTML component to the span inside the menu item)**

```
$(function(){
    setTimeout(function(){
        $('#menu-badge').append($('#html-component-variable').text());    
    },500);
});
```

![Screenshot for “Number Count in Badge With Extra Filters”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-10/scaled-1680-/image-1665776580328.png)

**Original Community Post:**

[Number count in badge with extra filters - Community Discussions / Pipes - Tadabase Community](https://community.tadabase.io/t/number-count-in-badge-with-extra-filters/394)
