Count boolean "true" contents


My app is about an online course. Users can mark an article as completed with the boolean component.

I want to show in the user profile a Chart component with the user’s progress, by displaying how many articles are marked as “true” (user-specific) by the user.

I used the Rollup, but the count results are the same for all users, not for each one.

How can I make it? Thank you in advance,

You will need a multiple relation that matches each user with the results/progress table.

Can you provide a screen shot that shows how your data is laid out? (from the Glide Data Editor)

hi Darren, thanks for your quick response!
I have a column in the course table, “Completed” boolean

Captura de pantalla 2022-10-15 a las 9.41.35

And in the user table, another column with the count

Captura de pantalla 2022-10-15 a las 9.42.38

Just it… I don’t know to make the relation boolen vs users

mmm, okay. You have a challenge.

The boolean column in your Courses table is User Specific, which means that the data in that column is only ever available to one user at a time - which is the user that is signed in (or the user that you are viewing as in the App builder).

So what you have at the moment is most likely giving you correct results - but only for the user you are viewing as. Unfortunately there is no way to summarise/rollup user specific data for multiple users.

So if that is your goal, I’m afraid you will need to re-think things a bit.

Would you like some help with that?

mmm so I don’t know if I’m doing it well…

I want to display summarise/rollup user specific for the current user (not for multiple users), in his user profile.

Is it correct?

Captura de pantalla 2022-10-15 a las 9.58.51

By the way, I really appreciate the help and the offer, but I think this problem is simple to solve, or it should be, right?

I have a list of other more complicated things that maybe if you need help pro :slight_smile:

If that’s all you need, then what you have should be fine. You should be able to test it by viewing as different users in the builder. The numbers should change as you switch from one user to another.

hehe, I wasn’t fishing for payment. I just wanted to confirm that was what you needed before I went to the trouble of outlining a solution :slight_smile:

1 Like

Doesn’t works… :frowning:

Boolean is not working as a user-specific value… why?
Maybe is better to do that with a button and custom action to define everything (mark as completed > add a number in completed articles, etc… ?

:slight_smile: I appreciate “the time”, and I guess if you’ll spend on my project, is good to pay for it.

Yeah, you can have a boolean as a user specific value, and that’s what I saw in your screen shot.

When you say it doesn’t work - can you explain more?

What do you do, what do you see, and how is that different from what you expect to see?

Doesn’t works because if I activate the value with a user, and I change to another user, is the same result. For this reason, in the user table, the count is always the same number for all users (and graph display always the same number, obviously).

Weirder… if I change between profiles several times, the value is deleted automatically for each one. :expressionless:

I don’t understand where is a different between that and the favorite boolean ??

I suspect that it’s working, but you might be not understanding or misinterpreting what you are seeing. When you are working with user specific column values, the results that you see in the builder can sometimes be a bit misleading or confusing.

Try this:

Open your published app on your phone or in a web browser, sign in as one user and check the results. Then sign out and sign in as a different user and see what you get.

Really? As simple as that :see_no_evil:
It works perfectly.

Thank you!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.