multiple contact selectors

Using Multiple Contact Selectors

First of all I would like to say that most credit goes to Scott Heim who wrote this great article earlier about using the Contact Selector.

With that said, now let’s get started on more tips and tricks on this userful control.

Now let’s see how our datasource looks like, after applying the steps in the Scott Heim’s guide.

Figure 1.1

Figure 1.1

Most people will want to use this control several times in their form. The problem is that InfoPath will not allow duplicate element names in the form’s datasource. Therefore, it is impossible to repeat the same datasource heirarchy which this control depends on.

Now to demonstrate how to overcome this problem, let’s check out the following steps:

  1. For the sake of the example, let’s say we have a repeating table, where I want each row to have it’s individual contact selector.
    We will start by creating the datasource for this table, you should have something looking like this:

    Figure 1.2

    Figure 1.2

  2. Now that our table datasource is ready to receive it’s ContactSelector.
    Rigth click on the original contact selector datasource “gpContactSelector” which we created earlier, and click Reference.

    Figure 1.3

    Figure 1.3

  3. Now choose the destination of the contact selector control reference.

    Figure 1.4

    Figure 1.4

  4. Almost done, now to test it, right click “grpRepeating”, and choose “Repeating Table”.

    Figure 1.5

    Figure 1.5

  5. You can see that the table was created but the last row has been rendered as a repeating section. Now right click the parent “Optional Section”, and choose “Change To”, then choose “Contact Selector”.

    Figure 1.6

    Figure 1.6

  6. And you’re done 🙂 , this should be your final result.

    Figure 1.6

    Figure 1.7

Please check back for more Tips & Tricks 🙂 See Ya!

Advertisements