Forum Academy Marketplace Showcase Pricing Features

:count but based specific value

My app contains a text element that displays the total number of entries I have in my app data.

But I only want it to the display the total number of entries that have a specific value in.

** For example, I have two data types. One data type called “Status” with two field types called “Submitted” (Field Type: text / List: no) and “Booked” (Field Type: text / List: no). My other data type is called “Journey” that contains a field type “Status” (Field Type: status / List: no), along with various other field types.

While my text element displays the total number of “Journeys”, I only want it to display the total number of Journeys that are “Submitted”, if that makes sense?

Any help would be very much appreciated. I thought it would work as a new constraint, but I am struggling to find the correct options available.

You should be able use the :filtered function before you use the :count function

Such as
Do a Search For Journeys:filtered:count
On the Filter set the constraints to only return the Journeys where Submitted = yes (or however you define if a Journey is Submitted)

2 Likes

That makes perfect sense now. I was trying to put the constraint in the Search for… :disappointed: Thank you @gf_wolfer :grinning:

1 Like

Hadn’t had my coffee yet when I answered, you actually should be able to filter the list on the ‘Do a Search for’ function and then use :count without the :filter function

You would use :filter before if it was on a list of defined things such as Current User’s Journey’s:filtered:count

1 Like

That’s what I was trying to do initially, but I couldn’t find anything in ‘Do a Search for’ that would display only the “submitted” journeys.

With your previous solution (which works fine by the way, apart from a bit of a delay with displaying the element on page load), I put “Advanced: This Journey Detail’s Status’ Status is ‘Submitted’” in the filter’s constraint.

Ahh I see. Yes, it all depends on how your data is structured and how you can reference the data.

I don’t think you can do the Advanced constraint on a Search. So in your case you will need to use that filter function (does take a fraction longer to do this second filter)

1 Like

If possible, take preference in putting constraints during search as opposed to the filter function. From what I understand, this places the filtering on the server, versus the client. It has the benefit of transmitting less data and the browser has to process less.

If it’s a filter you’ll be applying quite regularly, I suggest moving or syncing the field onto the nearest object.

2 Likes

Thanks @Scott

I would defo much prefer to use a constraint in the “Do a Search for…” - but I am having difficulties finding the correct constraint, so I am guessing that I don’t have any choice but to use the :filter option

It’s not anything I will be applying regularly, just the once on the main page of the app, but I am considering knocking it on the head and just doing without because of the delay.

I think I understand where you are coming from, re moving the field onto the nearest object, but I don’t think I can do anything else with it.

This topic was automatically closed after 70 days. New replies are no longer allowed.