How do I extract domain when user inputs email?
Options
![Patopt](https://us.v-cdn.net/6037124/user_avatars/5034377.jpg)
Patopt
Member ✭
I'd like to be able to get the @domain.com part out of the user email when signing up for my application. Any idea on how to do that?
Answers
-
Hi, Patopt.
For this, you can use a combination of filters.
1) Create a new variable, and use the email address as the value. Apply the "index" filter, with a value of @. This will return the character position of the @ in the email address--so, if my email is test@test.com, this would return 4, because the index starts at 0.
2) In whatever step you need the domain (or you can create a new variable for this as well) use the "substr" filter to extract the domain. Your value will be the email address. The "start" parameter will be the value from the first step, with 1 added (so it trims the @ symbol).
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback