Check for rude names?!

Do you know of a way to check users do not adopt a rude user name?

In my WORDL app, people enter a user name. Inevitably, there appears someone that enters a profanity. In this case, I would like to hide a button that completes the sign-in.

It’s straightforward to check for perfect matches. But I would prefer a safer solution, which scans the name to see if it contains a banned text (vs. 1:1 exact match).

AAA = AAA is quite straightforward
AAA contains AAA is the challenge

My app doesn’t use a Google sheet or Excel sheet, it only uses Glide tables.

Thanks in advance for any pointers.

Simon.

Maybe you can:

  • Split the name by space character
  • Have a separate table of banned words
  • Use a relation to relate the array in 1st step to the column of banned words
  • If the relation is not empty don’t allow submitting

Thanks but I believe this only finds whole matches. For example, if the user name is Banger and you want to block names containing bang, the relation fails. It works if the user name is Bang, but not if there is some extra text…

Ah I think I found a solution!

I use a template column and start with the Username. I can then replace rude words the character ‘!’. Then it’s a simple step to check to see if the template column has made a change…

image

(one extra step needed since the check is case sensitive: convert the name into lowercase using ‘Lowercase Text column’ and use this as the username reference in the template column)

Here is a JS option:

var words = p2.split(',');
p1 = p1.toLowerCase();
for (var word in words) {
  if (p1.match(words[word])) {
    return 'Oops!';
  }
}
4 Likes

Nice - but on this occasion the no code option is my preferred option :slight_smile:

Yes, it would be mine also. I just did that for a bit of fun.

2 Likes

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