0

I came across a sceneario where I need to bind Multi-selection Listbox control present in Infopath form 2010 with text field having comma seperated values .

Note : I am deploying my Infopath form 2010 to SharePoint List so I cant use any custom code.

Below is an example of what I am trying to achieve :

eg : TextField data : test1,test2,test3,test2 then the values of multiselection List box ( need to bind only unique values) will be : test1 test2 test3

Thanks for helping.

1 Answer 1

1

Edited

If you are looking for no code solution I don't believe it is possible.

Only workaround I can think of is to write some custom webservice that will get your data, parse it from comma separated values and then use it as external data source to populate choices in listbox. I used back on 2007 similar technique when working with no code browser forms.

Original answer - opposite solution

You can easily put selected Multiselection Listbox values to text field by using this formula:

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

(where field1 is name of your listbox binded repeating field)

You can set some other field to this value by using rule when you submit your form or on button click. After that you can propagate this field to list - but it really depends on your infopath form logic.

I don't quite understand why you need to bind only unique values since if your listbox contains same values when you select one you will select all items with same value. However if that is the case formula above will get only one.

You can find some more info on InfoPathDev Forum here.

2
  • Thanks Rasol for answering but I need exactly reverse of this i.e binding textbox comma seperated values to Multi-selection List box thats the reason I wrote that I need to bind only unique values.
    – Ash
    Jan 18, 2012 at 12:09
  • Uh, sry. I have updated my answer but as I stated in it: IMHO it cannot be done without code. Jan 18, 2012 at 13:54

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.