Polling/Voting In Lotus Notes

June 13 2007 10:00:00 PM Add/Read Comments [78]
I've been asked several times by customers, "Can I send a poll via email in Lotus Notes and have the recipients reply with their vote".  Well the answer is, not "out of the box", but due to the flexibility and power of Notes, of course you can set this up in just a few minutes!

This tip explains how to create a button in an email message which when pressed, prompts the reader to enter their vote, and automatically sends the response back to the address you define.

1. Create a new email message, and enter the text/graphics you want, explaining to the reader what the poll is about.  

2. From the Lotus Notes menus at the top of the screen choose "Create - Hotspot - Button".
Image:Polling/Voting In Lotus Notes

This will insert a small grey button into the email (#1 in the image below), open the Properties Box (#2 in the image below), and at the bottom of your screen you will see a new section open up where you will enter the information about the vote (#3 in the button below).
Image:Polling/Voting In Lotus Notes

3. On the first tab of the Properties Box enter the text you want displayed on the button (called Label) and customize the button's size, background colour, edge style, etc.  As you can see in the image below, I've choosen to have the button's width exactly fit the text I enter for the Label, have a light blue background, and have rounded corners.  If you wish, on the second tab of the Properties Box you can change the font size, colour, typeface, etc used for the Label.

Image:Polling/Voting In Lotus Notes  

So what started as a little grey button now looks like this: Image:Polling/Voting In Lotus Notes

4. Next you will enter the fomula that the button executes when it is pushed.

First, copy the text below to your clipboard:

choicelist:="Yes":"No";
email:="your full lotus notes email address";
title:="Voting";
message:="Please select your choice:";

choice := @Prompt([OkCancelList]:[NoSort];title; message ; "" ; choicelist);
@MailSend(email;"";"";@Name([Abbreviate] ; @UserName + " has chosen " + choice ));
@Prompt([Ok] ;"Finished" ; "Thank you for voting, your choice has been emailed.")

Second, paste it into the button's formula box as shown below:

Image:Polling/Voting In Lotus Notes

Third, customize the first four lines to meet the specific needs for your poll.

For example, you could do something like this:

choicelist:="Red":"Yellow":"Blue":"Green";
email:="Alan Lepofsky/Cambridge/IBM@Lotus";
title:="What is your favourite colour?";
message:="Please select your favourite colour from the list below:";

When the email recepient presses the button, they will see the following.  When they make their choice and press OK, an email will be sent to the address you defined.

Image:Polling/Voting In Lotus Notes


If you want users to be able to select more than one value, replace the line

choice := @Prompt([OkCancelList]:[NoSort];title; message ; "" ; choicelist);

with

choice := @Prompt([OkCancelListMult]:[NoSort];title; message ; "" ; choicelist);

That is all there is to it! What are you waiting for, go show off your new Lotus Notes Polling skills!



Additional Tip:

If you plan on sending polls often, instead of creating the voting button from scratch each time, you can place the button into a Stationary form, and then just change the things you need for each poll.

Note: To put a button back into edit mode, right click on it, and you will see the following menu:Image:Polling/Voting In Lotus Notes

  1. Patrick Kwinten
    1 | 6/14/2007 1:56:22 AM

    I guess I can here the question coming: does this also work with 'email over the internet'...

  2. Jonathan Roadley
    2 | 6/14/2007 3:45:50 AM

    Really wish this would be standard so to shut up Outlook users being converted over.

  3. Patrick M
    3 | 6/14/2007 5:08:48 AM

    I'm not sure if it's a good thing to show the users how easy a life we Notes developers have. ;)

    Good tip anyway. Thanks!

  4. Tom Brown
    4 | 6/14/2007 5:17:16 AM

    Yet, what if you want to get started in design? Or expand you Admin skill set...I'll leave the development to developers..yet a little design for admin types is always good...automate...automate. Even I understood the above and I stay away from design, if possible. Where else can you find info? Nothing in depth, easy to understand tips i.e. as above.

  5. Thomas Adrian
    5 | 6/14/2007 8:06:45 AM

    Here is another way to do it

    { Link }

    - Thomas

  6. Theo Heselmans
    6 | 6/14/2007 10:07:58 AM

    Note that most users don't have the 'Formula' box (as you need the designer for this). But they can use 'Simple Action', 'Add Action' and then '@Function Formula'. This will allow them to paste in your code too.

  7. Alan Lepofsky
    7 | 6/14/2007 1:15:36 PM

    @1, no it does not. This would be used for sending polls to your coworkers inside a company using Lotus Notes.

  8. Alan Lepofsky
    8 | 6/14/2007 1:16:58 PM

    @2, sure it would be nice... but at least now you can show them how easy it is to do.

  9. Alan Lepofsky
    9 | 6/14/2007 1:18:26 PM

    Tom, you ask where else you can find info. The Domino Designer Help Database has good starting examples, but I know we need to make it easier for people to "get started" learning Application Development.

  10. Alan Lepofsky
    10 | 6/14/2007 1:20:11 PM

    Theo, thank you for the update, I did not realize that.

  11. David Sanchez
    11 | 6/14/2007 7:37:02 PM

    What is the difference between using colon and semicolon in the choicelist variable to separate the choices?

  12. Alan Lepofsky
    12 | 6/14/2007 8:26:49 PM

    @11 David, sorry it was a typo. Thanks for telling me, I've updated the post.

  13. Pankaj Sharma
    13 | 6/14/2007 9:57:00 PM

    Great Tip.

    In fact I had downloaded a few apps for doing the same thing. Now I would try to do it through Notes itself.

    warm regards,

    Pankaj

  14. Peter de Haas
    14 | 6/15/2007 2:16:29 PM

    Alan,

    Your post triggered me to create a post on "how to" in Outlook 2007s I notes in the post not to start a functions & features debate, but rather to list a feature all Outlook users take for granted or don't know exists ...

    I hope you allow me my moment of fame :-)

    { Link }

  15. David Sanchez
    15 | 6/15/2007 6:57:29 PM

    Ohh I see how it is now, thanks for that, I couldnt script myself out of a paper bag, but this is quite easy to do.

  16. Ian Randall
    16 | 6/15/2007 8:45:19 PM

    @14 Peter, I think that you have missed the whole point of Alan's post.

    I don't believe that Alan's ever meant to turn this into a feature comparison between Lotus Notes email and Outlook 2007, but to illustrate how ANY Lotus Notes user (not just developers) can easily extend the out of box functionality of Lotus Notes within a few minutes. Polling was simply his latest example.

    This ability to empower end users with simple development tools has always been a strength of the Lotus Notes platform and doesn't just apply to the email template.

  17. Peter de Haas
    17 | 6/16/2007 12:43:30 AM

    @16 Ian,

    As I tried to make clear, it is not my intend to start a functions and features showdown.

    Sometimes however it is good to see that some functionality is available in Outlook which does not seem to exist in other mail clients.

    I am very aware of the good things Alan does for Notes users.

    Also aware of the fact that " end user development" is not unique to Lotus Notes Domino and in this particular case not necessary for Outlook users ;-)

  18. Alan Lepofsky
    18 | 6/18/2007 1:18:22 PM

    Hi Peter, I have no problems with your post. Voting is a nice feature in Outlook, I especially like the tracking of the responses.

  19. Dean Hayes
    19 | 6/19/2007 12:28:56 PM

    Alan, so all addresses used have to be canonical then and *not* Internet format at all? When I tried to send my poll to myself I got a message saying that the button could not be saved in MIME or Internet format.

  20. Joe Hanke
    20 | 6/19/2007 1:16:38 PM

    This may come in very handy for us. Our students use DWA for their mail client. We have voting every year for Student Council Pres., V.P., etc. This last year was a fiasco with the possibility of voter fraud. I might be able to use this to send to all the students with some additional code to see if they have voted already.

    Thanks for the post.

  21. Alan Lepofsky
    21 | 6/19/2007 9:55:57 PM

    You're welcome Joe. However, if you want some more advanced features (like collecting the results, creating graphs, views to sort the data, etc) you may want to create a Polling Application in Notes. It could be very powerful without a lot of work, and offer more than my example here provides.

  22. Alan Lepofsky
    22 | 6/19/2007 9:58:39 PM

    Hi Dean, I've never tried with an internet address, but I can't see why it could not be used. I will try soon, and let you know.

  23. Sarah Scott
    23 | 6/20/2007 7:34:05 AM

    Is it possible with the button polling feature, to return a list of answers rather than an email from each user?

  24. Charles Robinson
    24 | 6/20/2007 8:20:17 AM

    @23 - Alan explains how to allow users to select multiple values in his post:

    If you want users to be able to select more than one value, replace the line

    choice := @Prompt([OkCancelList]:[NoSort];title; message ; "" ; choicelist);

    with

    choice := @Prompt([OkCancelListMult]:[NoSort];title; message ; "" ; choicelist);

  25. Alan Lepofsky
    25 | 6/20/2007 9:17:07 AM

    Hi Sarah, I think you are asking about the "collection" side of things, what you do with the results when they come in from the voters. If so, I'd suggest that rather than doing polls via email, you might want to use simple Notes database to collect the info. That said, I think I could do an additional blog entry, showing how to take the responses and put them in a folder where you can see the responses. I'll look into that.

  26. annie
    26 | 7/31/2007 11:08:07 PM

    The sample you gave wasn't finish isn't it? the additional tips regarding besides sending polls often, instead of creating from scratch all over again. That's the best part i need to know more. And this tips is used among the notes users only. Can it be viewed by the end user that using different types of email system such as yahoo,hotmail,gmail, etc?

  27. Alan Lepofsky
    27 | 8/1/2007 8:52:56 AM

    Hi Annie. Yes, the example was finished. What do you find missing? "That's the best part i need to know more.", when you compose a document, create the button as described in the blog entry, save the email as draft instead of sending, or better yet, create a stationary called voting. No, these will not work outside of Lotus Notes.

  28. Geff Oakley
    28 | 8/1/2007 3:14:38 PM

    Is this impacted by ECL? Will the Notes audience need to know the creator in order to use the button without receiving a Security Notification Alert?

  29. Alan Lepofsky
    29 | 8/1/2007 10:58:43 PM

    Geff, I would have to assume normal Notes security rules would be enforced.

  30. annie
    30 | 8/6/2007 10:21:17 PM

    Oo...ok...Thanks a lot Alan, I'm trying to figure out on how to make a simple survey in new memo to be sent out to external mail. Since this won't work, i plan to make the choices of answer in link hotspots. But at the end will get the result as your sample. i have 0 knowledge of lotus programming, and don't have idea on where to put the coding at the right place. Pls assist.

  31. Alan Lepofsky
    31 | 8/8/2007 1:00:14 PM

    Hi Annie. This may not be what you want to hear, but if you are telling me you have zero knowledge in Notes programming, then me helping you through this is going to be tough. Why not hire a consultant to help, it may have some up front cost, but it will save your company a TON of time, and time = money.

  32. annie
    32 | 8/10/2007 3:35:01 AM

    Not to say 0 actually..in Designer there are so much place to put a code. and got confused of so much terms in it . I've tried on error to all possibilities found through net but still fail. Nevermind, thanks for you help then.

  33. Alan Lepofsky
    33 | 8/10/2007 9:24:23 AM

    Hi Annie, sorry that you are having problems. If you have specific questions, you should post on the developerWorks Notes forum and experts from around the world should be able to help you.

  34. Zede
    34 | 2/5/2008 10:45:12 AM

    I think this tip is just great. I work at a large company that uses Lotus but end users have no idea about all this functionality. I've scoured the web for decent end user training on Lotus and this blog is the jackpot; easy to understand, clear step-by-step instructions, don't need to be a developer (as little ole me doesn't have access to most features).

    The corporate department that deals with Lotus never shares any of this stuff, plus we're still on R6.5!

    Thanks Alan, plus all those who added comments.

  35. Alan Lepofsky
    35 | 2/5/2008 11:54:37 AM

    Hi Zede, thank you so much for the nice compliments! I hope this blog, plus all of the videos I link to help train your users. Any plans to upgrade to Notes 8 soon?

  36. Kalyan Verma
    36 | 3/5/2008 3:06:48 PM

    Hi Alan, this is a great post. I was using Outlook for 4 years and now i joined a new org and they use Lotus Notes. One question: Instead of hardcoding the Email address, can we populate it with To and CC emai addresses?

    Regards

    Kalyan

  37. Kalyan Verma
    37 | 3/5/2008 3:22:07 PM

    Hi Alan,

    Im trying to setup a sign-off email with 4 options. When the user selects 2, 3 or 4th option and click OK, they should be prompted to enter the issues and Click OK again. This action should give them a prompt that it has successfully been recorded close the voting email. Is this possible?

    Regards,

    Kalyan

  38. Alan Lepofsky
    38 | 3/6/2008 8:57:36 PM

    Kalyan, that is a good idea. Rather than hard coding the name, you could have the votes just go back to whomever sent the email in the first place. Replace the existing line with email:= From;

  39. Alan Lepofsky
    39 | 3/6/2008 9:09:03 PM

    Yes, that is possible using a combination of @If statments, and @Prompts, but it sounds like you are getting to a level of complexity where this is better suited as an application, or a stored form emailed to the users, not just a button.

  40. SG
    40 | 4/17/2008 12:56:59 PM

    Lotus Note: Designed by techies for techies. Others stay away!! As a user (not techie) of Outlook, I could create my polls on my own. Sucks to now have to use Lotus Notes. What a horrible user experience :(

  41. Alan Lepofsky
    41 | 4/18/2008 9:15:13 AM

    SG, thank you so much for the eloquent and detailed post, especially since you did so anonymously. What version of Lotus Notes are you using, and would you care to provide some details of what parts of the experience you feel were better when you used Outlook? (besides polling which is obviously pointed out in this post) Have you used Lotus Notes 8 yet? Do you use Notes for anything more than just email?

  42. Kara
    42 | 4/30/2008 10:43:49 AM

    Alan,

    Is there a manual or something that has the Lotus Notes functions and scripting? I want to learn what some of the functions are for Lotus Notes.

    Also, is it possible to set up a "yes" or "no" poll, and when the responder clicks "yes" a reminder or event will appear on their calendar?

    Thanks for your help! :)

  43. Alan Lepofsky
    43 | 4/30/2008 3:48:20 PM

    "Is there a manual or something that has the Lotus Notes functions and scripting"

    Yes, Domino Designer Help.

  44. Louis
    44 | 5/5/2008 4:59:04 AM

    Hi Alan!

    Nice tutorial. Unfortunately, it doesn't work.

    For some reason, the field for inserting the code is disabled in our Lotus Notes installation. AND, we have 6.5. Corporate policies... can't mess with them.

    I must say though, that, also after coming from Outlook (and I am not a big fan of MS myself, as I use Linux at home) the experience is indeed disappointing, as SG said.

  45. Louis
    45 | 5/5/2008 6:28:16 AM

    Me again.

    We figured out how to insert the code (Add Action > @Function Formula) but then there is still an even greater challenge: in Outlook, on receiving the reply, it would show a statistic of the answers attached to the sent email. This is very useful when expecting replies from many persons (which happens in a big corporation).

  46. Chuxydoodle
    46 | 7/11/2008 12:40:43 AM

    Thanks for the post everyone. I noticed that the user can skip all the choices and just choose OK. Is there a way to not allow the user to proceed without making a choice?

    Thanks for the help!

  47. Breeze
    47 | 7/22/2008 12:34:06 PM

    I am interested in the answer to post 46.

    Also, is it possible to set up a "yes" or "no" poll, and when the responder clicks "yes" a reminder or event will appear on their calendar?

  48. Alan Lepofsky
    48 | 7/28/2008 11:27:06 AM

    Yes, it is certainly possible, but not out of the box. This would take some programming to create the code behind the button. If the user pressed yes, it could create the calendar entry on their calendar.

  49. PAN
    49 | 10/10/2008 7:34:04 AM

    Great steps in creating poll, worked easily and I created stationery.

    Question: I have four questions, not one. Each button sends separate email.

    I am guessing script changes to allow each button to respond and then email. Or one button for all four questions. Can you provide example? Thanks!

  50. Ravi
    50 | 10/13/2008 7:37:15 AM

    Hi Alan,

    Thanks for such a nice tip to create a poll. Everything is explained clearly.

    I have one question, if it is possible to add an input box to put some text, once user has chosen an option, where user can put some feedback ?

    Thanks a lot for your help.

    With regards

    Ravi

  51. Ingrid McDaniels
    51 | 11/11/2008 3:48:46 PM

    Is there any way to get the subject line on the voting response to reflect the question they are responding to? I would like to use this function for multiple questions.

  52. Madeleine Camm
    52 | 11/26/2008 2:51:53 PM

    Thanks so much for this tip; I was looking for exactly this info. It didn't work for me quite the way it was described, though. Instead of pasting the text into the button's formula box, I had to click Add Action (the two drop-down menus beside Run were greyed out and set to Client and Simple action(s)). Then in the Add Action dialog box, I chose @Function Formula from the Action drop-down list and pasted the text in there.

    Just hoping to save someone else the time of figuring it out.

    Again, thanks for the tip!

  53. Greg
    53 | 2/11/2009 2:18:25 PM

    Hi Alan,

    Thank you very much for this great tip!

    I'm curious to know what your response to Pan [42] is. Along similar lines, I'd very much like to know how this tip could be modified to include responses from multiple button formulae...

    I created two butons and added the code per your example to each button so that each presents the e-mail recipient with a separate choicelist. Next, I edited the formula for the first button, deleting the email field and the @mailSend function, and renaming the choicelist field to choicelist1 and the choice field to choice1. Finally, I edited the formula for the second button, similarly renaming the choicelist and choice fields to choicelist2 and choice2, respectively, but this time keeping the mail field and the @mailSend function.

    I tried to reference both the choice1 and choice2 fields in the fifth/last parameter of the @mailSend function (the subject line in the automated e-mail reply) in the formula for the second button, but it only returned the value for choice2. It would appear there is a scope issue: it seems that fields are local to the code/formula for each button. What might I do to be able to refer to both choice1 and choicelist1 in the code/formula for the second button?

    When I tried search for help on the web (+"Lotus Notes" (polling OR voting) +"multiple buttons") and through IBM's Lotus documentation, all the relevant hits referenced code related to multiple buttons on forms, not simple e-mails. Although I am an experienced senior database programmer, I don't have the time to get too fancy with this, and didn't want to delve into Lotus Notes forms and databases.

    Great post! Thanks again, and I look forward to your response.

    Greg

  54. Richard Talbot
    54 | 3/27/2009 4:49:50 PM

    I'd like to use this button script for a meeting roll call with not only an option to select yes:no, but also to request who will be attending as a backup rep in case the answer is No. How would I add a conditional IF choice="no" with a text field input request?

    Example:

    Are you attending the meeting today? <Yes:No>

    If no, who are you sending as your rep? <insert their name here>

  55. KL
    55 | 4/1/2009 2:43:09 AM

    Thanks a lot for your help!! Have been searching for this solution for months! We had been collating manually for a long time.

    May I know if there is any way for the first choice to be selected by default? Because some people clicked OK without selecting "Yes". Which ends up with a "thank you" dialogue box without sending anything to the stated email address.

  56. Alan Lepofsky
    56 | 4/5/2009 11:56:57 AM

    Yes, in the line @Prompt([OkCancelList]:[NoSort];title; message ; "" ; choicelist) , instead of "", use "Yes"

  57. KL
    57 | 4/7/2009 1:42:06 AM

    Oh my, it works! Thanks a lot to you, Alan. =)

  58. Frédérique van ’t Groenewout
    58 | 4/8/2009 3:38:05 AM

    Hey guys,

    I've got a question about processing the answers.

    I created a poll about attending a presentation (either "Yes" or "No"). I was wondering if the answer can be saved automatically in an Excel or Word file? This way I will have a fast overview of the people that will attend.

    Thanks, Fred.

  59. KL
    59 | 4/17/2009 2:15:12 AM

    For me I use mail rule to get the results into folder and automatically count them for me and list it out.. but I can't maipulate the list alot.

  60. KL
    60 | 4/20/2009 4:21:23 AM

    Hi Alan,

    Would like to know if it is possible to mail voting response to more than 1 person? If so, how do I do it? Thanks a lot for your help.

  61. Alan Lepofsky
    61 | 5/4/2009 9:49:11 PM

    Try replacing email:="your full lotus notes email address"; with email:="your full lotus notes email address , second full lotus notes email address";

    I've not tried it, but it could work.

  62. KL
    62 | 6/13/2009 12:32:20 PM

    I managed to find out how it works! Thanks alan for your reply.

    email:="your full lotus notes email address":"2nd email address";

  63. Ti
    63 | 7/14/2009 8:43:35 AM

    Alan, THANKS! Like Ravi I'm interested in finding out if....

    "...it is possible to add an input box to put some text, once user has chosen an option, where user can put some feedback ?"

  64. Alan Lepofsky
    64 | 7/14/2009 9:21:01 PM

    Yes, you could using an @Prompt box, using OkCancelEdit.

    { Link }

  65. Prakash S
    65 | 7/24/2009 4:29:21 AM

    Alan, Thank you so much for this tutorial. I have a different requirement. I would like to code it. But where can I find the language tutorial. Also what language is this? LotusScript?

  66. Alan Lepofsky
    66 | 7/24/2009 12:41:36 PM

    You can start to learn about development here: { Link }

    for example, this page has a lot of good links for you

    { Link }

  67. Christopher
    67 | 7/30/2009 7:50:59 PM

    Hi Alan, thanks I was looking this for a long time. I have a question, is there a way to set different questions for example with single, multiple and open responses in the same button?

  68. Prakash S
    68 | 8/11/2009 4:42:32 AM

    Hi Alan, How can we get the "user id"? My organization uses employee no. as user ids and I need to put them in subject line. I searched in @commands, @username and @name. But couldnt find. Can you please help me?

  69. Alan Lepofsky
    69 | 8/12/2009 12:29:29 AM

    I'm not sure what you mean by user id. You don't really choose what to use as a user ID. Your ID is your name/org unit/org, like Alan Lepofsky/Cambridge/IBM. What does your ID look like?

  70. Prakash S
    70 | 8/12/2009 3:19:25 AM

    Hi Alan, Thanks for your response. In my lotus notes I can enter a employee number like "187920" in To/cc/bcc fields and press enter key to get Prakash/CHN/TCS. To get Prakash/CHN/TCS in @ formula function I can use @username or @name commands. My question is how can i get 187920 ie the employee no?

    When I used "Show Name Details" it showed

    Short name/UserID: 187920.

    So how to get shortname or userid using formula function. Thanks in advance.

  71. Kathleen
    71 | 11/18/2009 4:56:05 PM

    Hi Alan,

    This works great..however, when you send someone the poll, they click on the answer, it sends the email back with the answer in the subject line. However, it does not save the email in the sent view. Is there a way to get it to save a copy in the sent view?

    Thank you in advance

    Kathleen

  72. AB
    72 | 2/11/2010 6:40:03 AM

    Does anyone know if it is possible to add an input box to put some text, once user has chosen an option, where user can put some feedback ? I know Alan stated that we can use the Prompt box, using OkCancelEdit, but the link doesnt work.

    Help!!!! :-(

  73. Alan Lepofsky
    73 | 2/16/2010 9:17:50 AM

    AB, which part does not work? Please post the code you are trying, and explain what is going wrong.

  74. Emma
    74 | 2/21/2010 10:43:24 PM

    Is it possible to limit it so the user can only respond once?

  75. sundaram
    75 | 6/1/2010 8:55:18 AM

    Alan, great tip and it works. Always felt this was one of the weakness against Outlook. You said you will write another blog on how to collect/track the results rather than getting individual mails. Have you done that?

  76. Tom
    76 | 7/21/2010 9:05:05 AM

    Alan- Trying to do something similar to AB, but I'm missing something here (only receive a blank email, not the actual comments).

    @Prompt([OkCancelEdit]; "Additional Comments"; "What do you think?"; "Enter your comments here"); @MailSend("email address here");

    @Prompt([Ok] ;"Finished" ; "Thank you for your feedback.")

  77. Alan Lepofsky
    77 | 7/26/2010 9:06:19 AM

    @76 Hi Tom, sorry I don't have access to Domino Design these days, so I can't take a look. I suggest asking on the Notes/Domino forum on developerWorks.

    { Link }

  78. PM
    78 | 7/28/2010 10:43:36 AM

    Hi Alan,

    Great post! For some reason, I'm unable to edit/add coding to the button's formula box. Next to "Run" the drop down bar reads "Client" and "Simple action(s)" that are both grayed out (unable to be clicked or changed). Any idea on what I may be doing wrong?

    Thanks!