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.

  • Not yet re-checked
  • Classic builder

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”

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

Screenshot for “Number Count in Badge With Extra Filters”
Screenshot for “Number Count in Badge With Extra Filters”

Parameters

  • Name: Logged In Users Company
  • Slug: loggedInUsersCompany
Screenshot for “Number Count in Badge With Extra Filters”

Headers

  • X-Tadabase-App-id
  • X-Tadabase-App-Key
  • X-Tadabase-App-Secret
Screenshot for “Number Count in Badge With Extra Filters”

Response

  • JSON - total_items - Total Items
Screenshot for “Number Count in Badge With Extra Filters”

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”

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

Text
<p><span id="html-component-variable">{YOUR_PIPE_VALUE}</span></p>
Screenshot for “Number Count in Badge With Extra Filters”
Screenshot for “Number Count in Badge With Extra Filters”

Step 3

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

Text
Projects <span id="menu-badge" class="badge"></span>
Screenshot for “Number Count in Badge With Extra Filters”

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)

Text
$(function(){
    setTimeout(function(){
        $('#menu-badge').append($('#html-component-variable').text());    
    },500);
});
Screenshot for “Number Count in Badge With Extra Filters”

Original Community Post:

Number count in badge with extra filters - Community Discussions / Pipes - Tadabase Community

Was this page helpful?

Something wrong or missing on this page? Tell us.