How to check % of User Profile completion

And again a very special question. I want to push users to finish their User Profile and Fill all the values after registration.


What I’m doing now is to ask only a few minimal questions for User Onboarding. But then I need to tell them on their User Dashboard that they only filled : 60% of their Profile. That would force the user to complete their profile. But not sure how to properly handle that. I mean columns like, Street, Phone, Adress can be checked for NULL values. But not sure how to handle that into a single MySQL query. Maybe go with JSON and handle that with expressions? Or maybe purely by SQL Statement? @Hyperbytes I guess you know that :slight_smile:

1 Like

What is your logic here? I mean - you have let’s say 20 db fields per user. If he enters some info in 10 of them and leaves the rest empty - does that mean the profile is 50% complete?

no calculated SQL fields in Wappler yet. so calculate percentage complete at client side. easy enough, just test for empty or zero values on fields and build the percentage from there I.e complete = (fieldname.empty()?10:0) + …
sorry can’t do it in full or check syntax, using phone on a train to london (hate the place so not a happy person)

edit. got those values backwards

@Teodor exactly. I think I don’t take every column deeply in detail. I think If I can reach with 10 Columns and 10 are filled = 100%. :smiley:

Just basic stuff… I won’t check if Infos are really VALID. Maybe I could, before inserting values, I’ll do some basic Check. Like min length for a street or for phone number. And only then Phone number is stored. That would give 1 Point. So each Column = 1 Point …

Youre Joking, youre doing support on your phone while sitting in a train … crazy :smiley:

Not sitting in a train… warm, tasty food, nice nature, cats sitting around me,… heaven on earth? :smile::ok_hand:t5:

On your page you can do exactly what Brian suggested.
Create a database query, which returns your fields per user and inside the query do the sum:

Profile: {{(db_field1 ? 10 : 0) + (db_field2 ? 10 : 0) + .... + (db_field10 ? 10 : 0)}} %

Ok @Teodor I’ll give it a try and come back to you. I guess we’ll have then another good solution, which users are happy to see !

1 Like

got to do something to fill a 3 hour journey @Freddy_Blockchain

Okay so I take a Field and put a “Dynamic Attributes”. Then check that for beeing null.

if db_field1 is NULL then count it. + if db_field1 is NULL then count it. + etc …

I’m just not sure how to click it, maybe i do it in CODE, as I don’t understand that TREE system… is it explained somewhere?

Check the code i provided above and replace the db_field values with your real field names.

@Teodor and @Hyperbytes amazing it just works!

I guess there is a strange BUG… I’ve took a screenshot.

If having that proper code here on left with (open_times ? 10 : 0) and edit the expression, it strips me the double dot (divide symbol) and it looks like that:

I guess there must me some Error or mistake with the intepretation … I did it now just with CODE, no CLICKY STUFF. Maybe I did a mistake???

We are going to check how to improve the ternary operator UI.


Wow, that would be wonderful.

my view from my window this morning @Freddy_Blockchain, hell on earth?