Expand my Community achievements bar.

SOLVED

2 Dropdown Lists Affect Email Submission Recipients

Avatar

Former Community Member

Hello,

I have 2 dropdown lists that I want the user to select names from and have their selections determine the 2 recipients of the form when it is submitted by email.

I also need the forms to be submitted as PDFs, not XML data.

Please help.

Regards,

Zero Zone

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Jessica,

I am out, so wont get to this until the weekend.

It would be the same basic appaorach though.

If you select the dropdown and in the Object > Field palette, you would type in the location for each item. This is what the user sees when they select the dropdown.

Then in the Object > Binding palette you would specify the actual email address for each location. These represent the .rawValue of the dropdown when a user makes a selection.

The same email button will do then, as long as it references the name of the location dropdown. The existing example really does show the approach, you just need to change the Object > Field items using Locations instead of Names. Then change the email addresses in the Object > Binding palette.

Good luck,

Niall

View solution in original post

26 Replies

Avatar

Level 10

Hi Jessica,

You need to check out the dropdown list. While the display values may have items like "Ramsey, MN", if you have a look in the Object > Binding palette you may have specified different values. If you have then you need to use these values in the script.

Also check that you have referenced the dropdown correctly.

If you have a look again at my example you will see that in building the cc string, I include a "&cc="

vCC = "&cc=" + ccEmail.rawValue;

Hpe that helps,

Niall

Avatar

Former Community Member

Ok, I think I've got the "cc" down, but I'm still not getting the result I want with the dropdown. You are correct that I have different display values, so I changed it in my script to the actual value, but it still isn't quite working.

Here are my actual values in the dropdown:

Capture-1.GIF

In the script I used 'joyce@zero-zone.com' instead of "Ramsey, MN" but when Ramsey, MN is selected, it is still sending to "email1@zero-zone.com" instead of "email2@zero-zone.com".

Regards,

Jessica

Avatar

Level 10

Hi Jessica,

That is expected because the dropdown does not have a rawValue of "Ramsey, MN".

Because you have the actual email addresses in the specified vlaues, you can make the script much easier:

vEmail = Page1.Location.rawValue; 

No if statement needed,

Niall

Avatar

Former Community Member

Thank you, Niall

And I hate to keep bugging you, but I do not want the email to go to those values. I have different specific email addresses I need this to go to. But, the reason I have those values in there is because I am using them for another button on the form.

So, it kind of goes like this:

  1. The form is filled out by the user and they select "Ramsey, MN" in the dropdown menu.
  2. When the user is ready to submit the form, they will click the "Submit to Accounting" button, and it will go to "joyce@zero-zone.com".
  3. When "Joyce" is done with her portion of the form, she will click the "Submit to Payroll" button, and it will go to the payroll person at Ramsey (which is not herself).

Does that make any sense?

Best Regards,

Jessica

Avatar

Level 10

Hi Jessica,

Then you are back to the if statement, but instead of testing "Ramsey, MN", you will need to test "XXX@YYY.com".

if (Page1.Location.rawValue == "XXX@YYY.com")

{

     vEmail = "email2@zero-zone.com";

}

else

{

     vEmail = "email1@zero-zone.com";

}

Phew...

Niall

Avatar

Former Community Member

Woohoo! Success!!!

Thank you for putting up with my persistence.

Regards,

Jessica