Using SmartObjects (or mail events directly) with repeating InfoPath fields

  • 24 November 2008
  • 3 replies
  • 0 views

Badge +3

Hi all,

I'm using the contact selector in InfoPath (browser-enabled).

This contact selector fills a repeating group with user ids. Now I want to send a mail to each of them.

I tried some different approaches but ended up with the need of a SmartObject. My problem is: How to create a smartbox entry for each of the repeating fields?

Any other ideas are very welcome.

marco


3 replies

Badge +3

I assume you have workflow behind this InfoPath form that will send the email...?


If you do, then I would suggest that you submit the form normally (not populating the SmartObject yet), then have your first event be a Server Event.  In the server event open the XML document, loop through the xml schema, and after each loop do your insert in to the SmartObject.


 The code to do this can be found by searching. Essentially your Server Event reads from the XML and writes to the SmartObject, and the Mail event then reads from your SmartObject.  Your mail event may also need to loop through the SmartObject.  If this is the case, then create another Server Event, a Process DataField for a counter and loop between the Server Event (separate server event to the one mentioned previously) and the Mail Event.


 

Badge

Hi marco, check out the following post for "Activity Destination Users based upon a Repeating XML element: http://k2underground.com/blogs/fromthebench/archive/2008/05/22/activity-destination-users-based-upon-a-repeating-xml-element.aspx

Badge +3

Thank you.

But I'm already know that I can use a repeating field as the destination.

I think my problem can only be solved by custom code, so I did it with a server code event and iterate through the repeating nodes and call my SmartObject to get the mail address from each username and add it to a process data field (; separated). Then I use this for the mail to.

marco

Reply