Select email address from lookup

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Select email address from lookup

Post by aarlauskas » 2019-12-06 14:09

Hi there, is there a way to select an email address (email field) from lookup field? What I'm trying do do is: after someone fills the form in, they then can select their name from the lookup field and this then auto-fill the email field with the email address assigned for their name. At the moment I can only type the email address manually and that works, but if I create two lookup fields for user name and email, then it will not sending email out. Can someone help?

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: Select email address from lookup

Post by aarlauskas » 2019-12-14 23:51

did I describe my problem that no one uderstands what I'm talking about or this is simply not possible? :D
I have a form with email field on my Appgini application. I'm using emailcode in hooks, that sends an email with content when tick a box in that form.
This email field has a pencil icon next to it, when clicked on it you have to enter the email address of the recipient.
What I'm trying to achieve here is, because I know all email addresses, I want to create a lookup field that fills that email field automatically.
So I have created another table (Parent). In this table there are three fields (ID; eng_name; email_address).
In the main table there are multimple fields for data and then lookup fields (name & email) which points to parent table.
When selecting name from lookup field it then auto-fills the email field with the address assigned to that name, no problem, but then the email just doest send anything.. Why? It only work if email field is set as not a lookup and you type the email address manually..
Can someone help please?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Select email address from lookup

Post by pbottcher » 2019-12-15 19:35

Hi,

it does not really help to post the same question in multiple areas.

To your question:
in your first post you did not specify what exactly you try to acheive. Hence it is quite difficult to help.
In the explanation it get clear.

If you use a lookup for the email address, then you cannot use that field directly in the hook in order to the value of the lookup.
To say: If your entry has the ID=10, then the email lookup will contain 10, and not the email address.

In order to retrieve the email you need to query the database and retrieve the value of the joined field for that ID (e.g. 10).

Hope that helps.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: Select email address from lookup

Post by aarlauskas » 2019-12-15 21:47

Sorry for duplicate posts here, I wasnt sure if I posted at the right place. I wanted to delete them, but could not find the delete option.. I did figure that out about querying the database. I found my typo in query line last night and everything works fine now! :) Thanks for your reply pböttcher!

Post Reply