Hello! Any ideas on how to capture the email domain on sign up and then associate it with a value in another field (in this case a company)?
The purpose of this would be to group users with their companies based upon email domain so they can be assigned the appropriate workspace. Example: tony@kitchens.com signs up.
Capture @kitchens.com as the company domain and then:
2a. If a @kitchens email has never signed up before, ask the user to assign a company name value that will then be associated with all @kitchens emails going forwards.
2b. If an @kitchens.com email has signed up before, assign the same company value associated with that user.
I’m not sure, but I’d do this one of two other ways if I were building this.
1st way - Have a company code that every user enters on signup and use that code to link the user to the appropriate company.
2nd way - In stead of individual users signing up have an admin user for the company add users that way they are automatically linked to the same company.
Not sure if either of these ways would work for you, but there are options
There are 2 was I can think of, either use the Arbitrary Javascript component, which as you are new you probably do not have, or use a backend service like Xano and a custom action.
Here is a video showing both methods. Neither option is simple or straight forward, even though what you are asking sounds like a simple thing to do.
Thanks @Bobby I have tried out the company code and it is certainly good to have as a back up but hoping I can implement something a little cleaner using Xano or the Arbitrary Javascript component.
I will be building this functionality too
@TKOTC Thanks for such a complete response! Really appreciate it.
Thanks again for the help. Does the Xano methodology you used require any JSON? I am referring to the field that is just out of shot at about 34 seconds.
Thanks again @TKOTC - that makes sense. Is there any reason you can think of that would mean the result of the custom action result does not always appear as a magic text option?
The reason your result is not returning is a simple error to fix @1:00 into your video where you show the request. The issue is that you do not have a default value set in the Email field on the right hand side. @1:04 the url becomes ?to_parse=undefined rather than a proper email. If you enter in a default value at the 1 minute mark it will have the Magic text return so you can use it.
For a little more information into the problem (this is for completeness, not that you need to read on). The test successful comes from a positive 200 response from Xano, ie the domain associated with undefined is blank. So Xano has told Adalo the email portion of the test value is blank, in RESTful terms
Status 200, body: {}
If you enter in the email in the default field you will get
status 200, body: { “result”:“domain.com” }
then Adalo will auto-magically detect “result” and use that for Magic text.
If you rerun the test again without a proper email your magic text will disappear again.
In summary, when you are testing the URL, ensure that the to_parse is indeed a proper email address and you will not run into issues in the future.
Again, you’re very welcome. If you get stuck on other issues, or if this issue rears its ugly head again feel free to start a new thread or post back here.