Data Protection. with *

Hello there,

I was wondering how I would convert text/numbers into ‘*’ for example an users email would show as U********@gmail.com replacing User1234@gmail.com and 07******** for the Phone Number not 07123456789

As well as when resetting passwords it’d send a code to the users mobile but only show up as

We will send a code to your Mobile ending in *789

or We will send a code to your email U********@gmail.com

How would I go about doing that?

Still need help with this :slight_smile:

Try the “Truncated to” function

Where do i get that?
ezgif-3-9a909b4618

@indianaroleplay99, another option would be to use regex for this.

This way you can replace numbers by ‘*’.

image

The Bubble manual contains some info about regex and just search the forum/internet for more info about regex.

Note, the mail addresses are still send with the original characters to the frontend this way. So what you probably want to do is add an extra field to the data type where you save the user email and save the obfuscated value there. Next display this value on the frontend.

1 Like

I think :findandreplace is found only in Text values? I cant see in the list for Number Values
ezgif-3-9a909b4618

Hi there, @indianaroleplay99… I was in the process of typing a response when @gerbertdelangen responded, and my response is exactly the same. I would create a new field (text) called something like email masked, and when a user signs up, I would use a regex pattern to replace most of the alias with asterisks. For example, this pattern replaces all but the first and last letter of the alias: (?!^).(?=[^@]+@)

You would use the regex pattern like this…

Hope this helps.

Best…
Mike

1 Like

Thanks i’ll give this a go :slight_smile:

Dispite a small error my side the - not = LOL

that worked
image

Thanks so much for your help :smiley:

1 Like

Cool. If it helps, here is the mask for the phone number.

2 Likes

lol was just working on that :smiley:

Oh, wait… that pattern will only show the first digit of the phone number. Eh, you get the idea by now, so I’ll let you take it from here. :slight_smile:

1 Like

Thank for your help

1 Like

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