1
votes

I am very new to Infopath, and need some architechtual guideslines. My scenario is as follows:

I have a Sharepoint list, let's say it contains beer, and three items of it: "Kronenbourg", "Corona", "Tuborg". "Beer" is a content type, derived from Item.

What I need to do :

I need to create a "dynamic" Infopath form, that presents the user with a CheckBox for each beer. If a new beer is added to the Beer list, a new Checkbox should show up on the form without intervention, even on saved instances of the form. I have not decided what should happen upon deletions.

I then need to save this infopath form, including the selections, in a sharepoint form library, so that the users can go back to one of maybe many beer-forms that they have saved, and maybe change the selections.

I also need to build a string from the selections at some point in time, and present this string in a visible column in the form library, but thats beyond the scope of this post.

What I managed to throw together so far:

I have a kind of working Infopath form. I have added a sharepoint dataconnection to the Beer list, and dragged a repeating table to the design area. This "works", i get a list of my list items. I then added dummy Y/N field to my beer content type, selected it in the fields, and now i get a neat checkbox next to my records.

Obviously this does not seem right. I do not need to save anything back to the Beer table, I only need to use the beer table for lookup, and keep the selected choices in the saved instance of the form.

Ok, thanks for staying with me so far. What do I do here, can Infopath be persuaded to support a scenario like this, or am I better off building custom webparts? I think my main questions are:

  • Can I maybe attach an "input-only" CheckBox to a repeating list/section ? (and how do I refer to such dynamically created control)

  • How do I make Infopath load the choices dynamicly from db, but save the data in the instance of the form?

  • Should, and can I maybe attach a content type to the form library, representing the choices and somehow attach that to the form?

Thanks for any input

1

1 Answers

1
votes

If I understand your requirements, I think the thing to do here is to use a Multi-Selection list box (MSLB). This can have its values populated from a secondary data source (i.e. a list), and it would be bound to a repeating field that would automatically have values added and removed as values are selected and deselected.

As far as getting the selections into a single string, if you just want this value for a column of the form library that the forms will be submitted to, you can just use this repeating field as a promoted property, and use the "Aggregate" option to combine the values into one.

The other option would be to create a separate field to hold the string and use the "double eval trick" (please Google that) to combine the values into one. One gotcha here is that if you use double eval trick with a MSLB, you have to put the formula both in a rule on the MSLB's field, and in the default value formula for the target field.