Monday, November 19, 2012

Infopath 2010 - Select a Photo from Picture Library

1. Copy the picture library by going to Picture Library Settings – Save Site as template (and include content) – optional. You can use the existing if you wish.
2. Take note of the photo URL of any picture – you will need this later.



3. Create a new Custom list. Just add one field, Employees as Person or Group. Make this field compulsory. You will add in the rest of the fields from Infopath later.4. Edit the form in Infopath 2010.


5. Add a new Data Connection to point to the Picture Library.






6. Add in 3 Drop-Down List Box, and 3 Picture Controls.

7. Drag and drop the elements so that you have a form like this:

8. Make the Picture Controls read only. Repeat for all 3 controls.
 



9. Right click on the drop down list box on the form. Select Drop Down List Box Properties

10. Choose the data connection which was created in Step 5.

11. With the selection still on the drop down list box (on the form), add a rule.


12. Select the first picture control as the field.

13. Click on f(x) and put in the formula.


in the first field and third field, put in the first and last portion of the URL from Step 2.
 
in the middle field, double click and go to advanced view.


switch selection to the Data Connection created in Step 5.

Expand and select the ID.

Click on Filter Data, Add.
Select the equals to condition.
 
switch to Main connection.

Click OK, OK, OK …… the end result will look like this.



14. Repeat steps 9-13 for all drop down list boxes.
15. Add a new rule to the first drop down list for Validation.

16. Add rules to check for duplicates to the second and third drop down list. Basically to compare the photo selections for 1 and 2, 2 and 3, 1 and 3.

17. Disable native form submit from Form Options.


18. Add a button. Add 2 new actions for this button.

19. Publish the form and we’re done!
20. To make sure each employee can only vote once, just make the Employee a unique value in List Settings – edit column

Related Posts Plugin for WordPress, Blogger...