Survey @Prompt dilemma

I’ve been asked to put together a survey and I’ve seen this process done in Lnotes with @prompt. I’m looking for some assistance being new at this. I have several questions with a reply button – that works very well. I’m attempting to capture the results and send the response to an email address and that is where I’m at…BUTTON 1: @Prompt([YesNo];" Reply to the question, plz"; “Yes or No”);@If(tmpValue=1;@SetField(“resultq1”;“Yes”);@SetField(“resultq1”;“No”))

BUTTON 2: @Prompt([YesNo];" Reply to the question, plz"; “Yes or No”);@If(tmpValue=1;@SetField(“resultq2”;“Yes”);@SetField(“resultq2”;“No”))

BUTTON 3: @Prompt([YesNo];" Reply to the question, plz"; “Yes or No”);@If(tmpValue=1;@SetField(“resultq3”;“Yes”);@SetField(“resultq3”;“No”))

Finally, I have an “OK” button when they have completed the survey at the end which does 3 things:

  1. Action: SendMailMessage “Here is the results from the survey within notes…” – works just fine.

  2. @Function Formula: @Prompt([Ok];“Thanks”;“Thank you for your response. We’ve been notified of your response and look forward to servicing you again in the near future.”) – works just fine

  3. Action: DeleteFrom Database - works just fine.

So how do I get the response from the buttons in the email …

I appreciate all the help.

Pete

Subject: Survey @Prompt dilemma

You need to change your SendMail from an action to an @Fuction. Then you can add the text you want to your message:

BodyMsg := “Here is what they said” + @NewLine;

BodyMsg := BodyMsg + “Result 1 [” + resultq1 + “]” + @NewLine;

BodyMsg := BodyMsg + “Result 2 [” + resultq2 + “]” + @NewLine;

BodyMsg := BodyMsg + “Result 3 [” + resultq3 + “]” + @NewLine;

@MailSend( “To”; “CC”; “BCC”; “Subject”; “”; BodyMsg );

Subject: RE: Survey @Prompt dilemma

That looks like what really was needed and the SendMail is working great. Except that on the resultsq1, q2, and so on I’m getting all [No]. Is the syntax not right on the button ?

@Prompt([YesNo];" Reply to the question, plz"; “Yes or No”);@If(tmpValue=1;@SetField(“resultq1”;“Yes”);@SetField(“resultq1”;“No”))

Here is what they said

Result 1 [No]

Result 2 [No]

Result 3 [No]

Pete

Subject: RE: Survey @Prompt dilemma

I would expect your code needs to be:

tmpValue := @Prompt([YesNo];" Reply to the question, plz"; “Yes or No”);

@If(tmpValue=1;@SetField(“resultq1”;“Yes”);@SetField(“resultq1”;“No”));

Otherwise tmpValue never gets assigned and therefore the answer will always be no. Alternatively you could try this…

@If(@Prompt( [YesNo];" Reply to the question, plz";“Yes or No”);@SetField(“resultq1”;“Yes”); @SetField(“resultq1”;“No”));

Subject: RE: Survey @Prompt dilemma

That is working just great. Thank you for all your help !!

Here is what they said

Result 1 [Yes]

Result 2 [No]

Result 3 [Yes]

Result 4 [No]

Pete ;-))