Submit to filtered by list box

M

Marc

I wonder who could help me with this. I’ve got a Drop-down list box with the
name of different locations. Depending on the chosen location, when the form
is submitted it needs to be sent with copy to a group of different people. It
is possible to add the emails as Default Values of a Repeating Field in a
Repeating Group and then filter the emails according to the chosen location?
In this case, how can I filter the emails I would like to make appear in Copy
To when submiting? If this is not possible, how can it be done?

Thank you,
 
S

S.Y.M. Wong-A-Ton

You can use the "Filter Data" option on a repeating table to show only those
email addresses for the selected location in your drop-down list box. Then
you can use this neat trick that has been provided by the InfoPath Team to
create a list of email addresses from the filtered repeating table to be used
in the "Cc" field for email submission:
http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx
 
M

Marc

Thank you Wong! As always your insights are very helpful.

I almost did it! I’ve got a repeating Group called “eMailsâ€, with two
fields: “Location2†and “emailâ€. I made this last one repeating in order to
be able to enter more than one email per location in default values.

Then I’ve created a repeating table that depending on the value selected in
the drop-down list box “Locationâ€, filters the table “Location2†= “Locationâ€
and shows only the emails for that given location.

Finally I’ve created a Submit to with the following formula in Copy To:
eval(eval(eMails, 'concat(my:email, ";")'), "..")

The formula works (no error) but it always picks up the first email entered
for each location:

e.g.

Locations A and B
Emails for location A: (e-mail address removed) and (e-mail address removed)
Emails for location B: (e-mail address removed) and (e-mail address removed)

Independently of the location selected, it picks up (e-mail address removed) and
(e-mail address removed) because the filter is in the repeating table but not in the
source.

Any suggestion on how to solve this?
 
S

S.Y.M. Wong-A-Ton

You need to add the filtering to the formula too. When you are in the "Insert
Formula" dialog box and have clicked on the "Insert Field or Group..." button
to select the "eMails" group, there is a "Filter Data..." button at the
bottom of the "Select a Field or Group" dialog box. With this button you can
set up a filter for the "eMails" group on the selected location in the
drop-down list box.

Try it. I haven't tested it, so if it doesn't work, let me know; then I'll
try it out myself and dig a bit deeper for you if necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top