1 2 Previous Next 17 Replies Latest reply on Jun 15, 2010 7:15 AM by tinnesfreek05

    Email Contact from a 'Value List'

    tinnesfreek05

      Title

      Email Contact from a 'Value List'

      Post

      I am farely new to FileMaker and am using FileMaker 10 Pro. I have a drop-down menu right now that is using a value list of email addresses. When an email address is selected from the drop down an email is sent to that email address. I would like to display each persons name in the value list (instead of the email address) and then have the email sent to that person that is selected. I cannot figure out how to tie the persons name (that will be showing in the drop-down menu) to an email address. Any suggestions?

        • 1. Re: Email Contact from a 'Value List'
          ryan

          Go to File > Manage> Value Lists

           

          Select the Email Value List and Select Edit.

           

          Under "Use Values from Field", you can select the other field, in your case the name field, to appear in your drop down list.

          • 2. Re: Email Contact from a 'Value List'
            tinnesfreek05

            Thank you for your reply rdowler. Unfortunately this is not working for me so I must have something set up wrong. I have the email addresses entered as a value list. The field for 'contact names' is where I think my problem lies. When I create this field let's say it's called 'Contact Names', do I need to make another 'value list' to list each persons name? And does each person's name need to match up with the corresponding location in the 'email addess' value list?

            • 3. Re: Email Contact from a 'Value List'
              philmodjunk

              Try a two column value list with the person's email in column 1 and their name in column 2.

               

              That allows you to enter an email in the field, but see the person's name in the value list when you are selecting it.

              • 4. Re: Email Contact from a 'Value List'
                tinnesfreek05

                This is probably a really dumb question but how do you create a 2-column value list?

                • 5. Re: Email Contact from a 'Value List'
                  philmodjunk

                  Not dumb, just a typical beginner question.

                   

                  Open Manage | Value LIsts...

                  Create a new value list or edit an existing one.

                  Click the Use values from field radio button

                  You'll see two large white boxes--one for column 1 and one for column 2.

                  Select the table and field for your email addresses for the left column.

                  Click the Also show values from check box and select your name field for the second column.

                   

                  You could choose to hide the first column so that all you see in your value list is the persons' names, but then you have to make sure you never have two people with the same exact name or the second such person's email will never be accessible from this value list.

                  • 6. Re: Email Contact from a 'Value List'
                    tinnesfreek05

                    For some reason this still is not working. It doesn't display anything when I click on the drop down. It just becomes a text box I can type in. Does this help you any? I am pulling these values from 2 separate value lists that are attached to 2 separate fields correct?

                    • 7. Re: Email Contact from a 'Value List'
                      philmodjunk

                      No, this should be one value list that displays your values in pairs.

                      • 8. Re: Email Contact from a 'Value List'
                        tinnesfreek05

                        If I create a field though don't I have to actually use it in the layout to add a value list to it? If I do this as well as the above as you mentioned (the button where I can "use values from field") for each column I have to use a field. The first column as you said would be the email addresses and the second would be the names of the people. This would require 2 separate fields which means there should be 2 separate value lists. You make this sound really easy haha, I just wish it were! I do not want to show the email addresses to the user at all. You mention (1 value list that displays my values in pairs). Here's the way I take that when you say that:

                         

                        contact1@email.com Name1

                        contact2@email.com Name2

                        contact3@email.com Name3

                         

                        This would be 1 value list with my values in pairs. If I do this it displays exactly that in the dropdown. I just want it to show the name but send an email to the email address behind the scenes. I hope this helps! Thank you for all your help!

                        • 9. Re: Email Contact from a 'Value List'
                          philmodjunk

                          I see we've been arguing semantics here. Yes, the value list you are getting is exactly what I recommended. It's one value list with two columns of data. As I indicated earlier, you can hide the email column and just display the names if you wish--especially if you format your value list as a pop-up menu.

                           

                          I assumed you wanted to enter an email address in a field by selecting the person's name from a drop down list. The value list I"ve described does exactly that, you select a person by name from the drop down, but only the data in column 1, the email address is entered in the field. I've suggested keeping the email address visible, because you could have two different people with the same name.

                           

                          If you want to select a name like this and see an email generated and sent to that person, that requires a fairly detailed script.

                           

                          You could set up a global field formatted with a drop down list of just names.

                          You script would then search your database for all records with that name and

                          a) display a message if no email address is found

                          b) display a list of emails and other data if you have two or more people with that name

                          c) if just one match is found, use the email address just found with the Send Mail step to send an email to them.

                           

                          Is that what you want?

                          • 10. Re: Email Contact from a 'Value List'
                            tinnesfreek05

                            Yes, haha. Maybe we aren't on the same page. Basically what I have set up is a button that when pressed runs a script. The process is the user will select a person (from the drop down menu with ONLY names listed, first and last) that they need to notify. Once they have selected a person they will press the button which will send an email to the specified person (from the drop down) notifying that person that they have completed a task in FileMaker. I already have the script set up and working. Right now I have a workaround for the drop down list with just email addresses and in the 'send mail' script part i have "TO" pulling the field value (which is the email address). I want it to pull the field value if possible but to the user it shows only a First and Last name. Does this make more sense?

                            • 11. Re: Email Contact from a 'Value List'
                              philmodjunk

                              Well that's what I was describing in my other posts to this thread.

                               

                              The problem is that you can have two people in your database named John Smith or some such and you'll need to decide how to handle such duplicate names.

                               

                              Make the field you reference in the TO box of Send Mail your value list field on your layout. You can use the two column approach I described earlier, specify a pop-up menu instead of a drop down list and specify "show values only from second field". You'll see and select the name, but the value list actually enters the email address into this field.

                               

                              There's a catch to this approach, however. If you have two people with the same name, their name will only appear on the list once and you'll only be able to select the first email address. It'll be as though the second "John Smith" doesn't exist in your database. You have several options for handling this issue:

                              1. You can keep both columns visible in your value list. Assuming these names and email addresses exist in a related table, you can display the person's name in a second field next to the value list field.
                              2. You can set up a validation rule that enforces only unique first, last name combinations.
                              3. You can attach a script trigger to your value list field that searches your database for all emails matching the selected name. Since this is a script, it can handle the duplicate values and still enter the selected email address into a field your Send Mail Step can use to send the email.

                               

                              Here's a thread that describes such a "search field" technique. Where it enters a ID field value, your version would enter the email address into a field:

                              Tutorial: How to use an auto-complete drop down list when selecting records related by ID number

                               

                              • 12. Re: Email Contact from a 'Value List'
                                tinnesfreek05

                                Thanks Phil. I will work on this and let you know if I have more problems or the outcome if I get it working.

                                • 13. Re: Email Contact from a 'Value List'
                                  tinnesfreek05

                                  I never could get this to work correctly Phil. I guess I probably need to be walked through it step by step unfortunately. For now I am going to go with my workaround of just putting the email addresses into the drop-down list. If you have some spare time and would want to write this out step by step (from creating a field and what needs to be in it to creating a value list and exactly what needs to be in it) you might help some other people out as well. I really appreciate your time and help. Thanks again!

                                  • 14. Re: Email Contact from a 'Value List'
                                    philmodjunk

                                    What method works best for you for handling the duplicate name issue?

                                     

                                    Which step by step do you want? The 2 column value list or the scripted search approach?

                                    1 2 Previous Next