Presenting user name initials in the profile container (Xano Auth)

Hi all,
Is there a way to use the binding function to manipulate a text field to present only the initials of a user that is being “stored” at a username variable in Xano auth connected to my Weweb app?
If not, what is the best way to do that?

Thanks,
Ran

I would:

  1. switch the binding from “formula” to “javascript”
  2. find the username variable under “var”,
  3. click it,
  4. and then update the text as follows:
return [username variable clicked under "var"].split(" ").map(word=>word[0].toUpperCase()).join("");

If the username variable is “Ray Deck”, the above will return “RD”

2 Likes

Great, thank you!
If this is the username under Var -
variables[/* User name for initials */‘fd8c3074-4020-4db5-904f-8f495449d7ac’]

What should the final script look like?
Apologies - I’m making my first steps in working with code…
:man_facepalming:

@raydeck’s answer work, but you could also do it fully no-code using formulas:

What you’ll have to do is replace the variable (be it with @raydeck’s solution or mine) by the one you want to use as a starting point. In my example, it’s the currenlty logged-in username coming from the authentication plugin.

1 Like

Thank you so much!
It worked :grinning:

1 Like