10

I have designed an InfoPath 2010 Form which has Multi-selection List box(Datatype=Text[string]) with 5Choices and I have set a choice as default. Multi-selection List box field is promoted through Property promotion to appear on SharePoint 2010.

If I select a choice, it appears perfectly on SharePoint.

However, If I select more than a choice, it showing only the value of the first choice.

I would expect to show all the values, separated by comma.

Am I missing something?

3 Answers 3

8
+25

I've had a similar problem; SharePoint/InfoPath doesn’t seem to deal with multiple-selection list boxes very well (unless I'm also missing something). The workaround I used w/o code was to create a new hidden field with the default value set to:

eval(eval(MultiSelectField[. != ""], 'concat(., ", ")'), "..")

where MultiSelectField is your field

Tick "refresh value when formula is recalculated" this produces a field with all the values selected in it separated by comma's that can be then displayed in SharePoint instead of the multi-select field.

This does have the problem of treating "option1", "option2" and "option1, option2" as 3 different unique strings for the purpose of sorting and filtering as "option1, option2" is now a string rather than two strings displayed as a comma separated value. I'm still looking or a nice fix to that.

Good Luck!

Edit: Just remembered that you also have to add a rule to your multiple selection box that triggers when the field changes. This rule should set the value of your hidden field to the eval function above. You need this rule and the default value to be there or when the user ticks and unticks options the box will not update correctly.

9
  • Please let me know how to make the field as hidden field. Jan 14, 2014 at 1:53
  • @Karthikeyan in infopath place a textbox like you would normaly (any where on the form) then delete it. You'll notice its still listed on the fields list (to get the feilds list up click on the data tab up top, then "show fields"). This is because when you delete a control like the text box, it only deletes the control that the user see's not the field that was automaticaly generated when you placed it. Jan 14, 2014 at 2:03
  • @Karthikeyan Another way is: with show fields up, select the folder myFields and click "Add Field" under the actions section at the bottom. Jan 14, 2014 at 2:10
  • Agreed, this is the simplest way to do it using Infopath and sharepoint 2010.
    – Russell
    Jan 14, 2014 at 6:15
  • When I try to set the rule on the Multi select List box, it throws the error: Expected value type: , Actual value: [ eval(eval(.-->[<--. != ""], 'concat(., ", ")'), "..") Jan 14, 2014 at 15:29
1

In Infopath, when you have a multiselect list box, the "First" function is selected by default, and I think this is why you are only seeing the first value. You need to set it to "merge" under Form Option, Property Promotion, select your multiselect field then Function, Merge.

enter image description here

1
  • this is useful however values are merged, I expects a comma between the individual values. Jan 14, 2014 at 1:54
0

a multi-select list box stores the items that were selected as several fields under one group node; and not as one field. What this means is:

  • If you use Rules to set the value of a multi-select list box, you can only set the value of, and thus select, one item at a time; not several.
  • If you want to select several items in a multi-select list box all at once, you must use code to add several repeating nodes with the values that should be selected; you cannot use Rules to get this done.

For coding here is good example, which will guide you.

http://www.bizsupportonline.net/infopath2007/programmatically-select-all-items-multi-select-list-box.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.