writing values from a multiple-selection list box to another control - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

writing values from a multiple-selection list box to another control

Last post 07-12-2019 08:58 AM by Hilary Stoupa. 72 replies.
Page 2 of 5 (73 items) < Previous 1 2 3 4 5 Next >
Sort Posts: Previous Next
  • 10-08-2010 01:59 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Jimmy,  I was able to display the item description instead of the item ID by changing the value of the field to the description instead of ID.  However, is it possible to explain how to set the formula so it displays the first item checked immediately?  Currently, it will only display items after, at least, 2 items have been checked.

  • 10-08-2010 07:09 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    I don't know how to fix your form without seeing it with my own eyes or hearing a very detailed description from you of how you've set it up.  The form I attached in the post before yours doesn't have the problem you're describing, so you can try to emulate that, or attach your own form to this thread.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-11-2010 05:42 AM In reply to

    Re: writing values from a multiple-selection list box to another control

    Jimmy,  I will try and upload the form, but I'm not sure how.  Also the form is connected to SharePoint sites so I'm not sure if you'll be able to open it up or not.  Therefore, I've provided a detailed description as well. 

    General Functionality Description: The multiple selection box pulls job titles from a SharePoint list based on the selection of a drop down further up the form.  There can be anywhere from 40 - 130 job titles displayed in the multiple selection box.  The user selects one or maybe two job titles and information about those job titles are displayed in other text boxes further down the form.

    Problem:  Currently the selected job title may or may not show due to the large number of job titles. Example: When a user looks at the form after a selection has been made if it's near the middle or bottom of the multiple selection they would have to scroll down to see what was selected.    I'm trying to get the selected job title to show in a text field directly below the multiple selection box, but it only shows job titles after more than one selection has been made, 90% of the time the user will only select 1 job title.  How do I get the code to show the job title as soon as it's selected and not wait for more than one selection to be made?

    Code: The code in the text box that I want to display the job title is: eval(eval(ProjCatCode2, 'concat(., " ")'), "..")

    Does this help? 

    Thanks,

    D

     

  • 12-08-2010 04:11 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Jimmy, you are a gentleman and a scholar.  Thanks for your solution.

    Leland

  • 12-08-2010 04:12 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    Hilary, thanks for providing the sample that got this started.

    Leland

  • 01-26-2011 01:36 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    I'm trying to append to field2 the value selected in the dropdown preceded by a semi-colon, it keeps replacing it.

    Note: point data source to a sharepoint site; select "add contacts" to populate dropdown list.

  • 01-26-2011 08:03 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    The double-eval trick operates on repeating data, not on single fields.  You have to direct it at the location the data is coming from.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-04-2011 11:38 AM In reply to

    Re: writing values from a multiple-selection list box to another control

    I have been able to use the double eval method to get the values of individual multiple selection list boxes into separate text boxes, and thank you for yours and the others' posts here, but we have an additional issue in that we have several multiple selection list boxes that we need to have their combined values go to one field, with a separator between everything.  I was able to concatenate the double eval formula but not able to separate the different groups of results.  Example:

    MultiSelectBox1:
    Apple
    Orange
    Pear
    Banana

    Added a Rule to MultiSelectBox1:  Condition is if it is present and Action is to set the value of the AllSelectionsTextBox to:

    concat(substring(eval(eval(MultiSelectBox1[. != ""], 'concat(", ", .)'), ".."), 3), substring(eval(eval(MultiSelectBox2[. != ""], 'concat(", ", .)'), ".."), 3))

    MultiSelectBox2:
    Pie
    Cake
    Torte
    Muffin

    Added a Rule to MultiSelectBox2:  Condition is if it is present and Action is to set the value of the AllSelectionsTextBox to:

    concat(substring(eval(eval(MultiSelectBox1[. != ""], 'concat(", ", .)'), ".."), 3), substring(eval(eval(MultiSelectBox2[. != ""], 'concat(", ", .)'), ".."), 3))

    Added a hidden AllSelectionsTextBox on the form that will be promoted to a SharePoint Library.  Made this the Value of the Text Box:

    concat(substring(eval(eval(MultiSelectBox1[. != ""], 'concat(", ", .)'), ".."), 3), substring(eval(eval(MultiSelectBox2[. != ""], 'concat(", ", .)'), ".."), 3))

    Results:  items in MultiSelectBox1 are separated by a comma (good), but then the last item from that group runs into the first item of the group MultiSelectBox2 (although that group's items are separated by a comma which is good).  Example:

    Apple, Pear, BananaCake, Torte, Muffin

    How can I get the comma between Banana and Cake?

    Thank you for any help you or anyone else checking this post can offer!

    Nalani

     

  • 05-04-2011 12:05 PM In reply to

    Re: writing values from a multiple-selection list box to another control

    I just read in the last few days several posts related to this. One of the solutions I noticed was a user placed a "," after every word even if there was only one word. Ultimately this is not the cleanest solution, but it may be a work around. I will see if I can find thiose posts.

    Kind regards,
    Larry
  • 05-31-2011 09:39 AM In reply to

    • Latte
    • Not Ranked
    • Joined on 05-19-2011
    • Posts 15

    Re: writing values from a multiple-selection list box to another control

    Been trying this andh runize I need to do 2 things; 1. Add a default formula for the text box 2. Create a rule on the muliple-item list box Both of thes with the same double eval formula of course. I've successfully done this, but I think there's a problem with my rule. When I select the desired boxes from the muliple-item box it only populates the last selected item. When I deselect then the items are selected properly, this leads me to believe the issue is with the rule but the formula for the default value of the text box is working properly. The xpath from my rule gives me xdMath:Eval(xdMath:Eval (xdXDocument:GetDOM("Suppliers")/ dfs:myFields/dfs:dataFields/dfs:Suppliers/@ID [../@Company = current()], 'concat(.,"#;")'), "..") I'm displaying a filtered ID for an item in the text box. Any suggestions? Thanks.
  • 11-27-2011 05:50 AM In reply to

    • serhat
    • Not Ranked
    • Joined on 11-27-2011
    • Posts 1

    Re: writing values from a multiple-selection list box to another control

    I have a similer question.. Little bit complicated. I dont know how to explain.

    I have a countries list in sharepoin 2010. And another list to group some of the countries. This list is a must becuse these groups' members are changing regularly. and in another list I want to store countries' values by selecting a group from 2nd list. In this way countries saved in 3rd list will not change even the groups' members changes rom 2nd list.... Please any advise ?

    Sharepoint List 1
    ID Title
    1 Country 1
    2 Country 2
    3 Country 3
    4 Country 4
    Sharepoint List 2
    (Groups of countries created from list 1)
    ID Title Member Countries
    1 Country Group 1 Country 1, Country 2
    2 Country Group 2 Country 2
    3 Country Group 3 Country 2, Country 3, Country 4
    4 Country Group 4 Country 1
    Sharepoint List 3
    (Using infopath form to populate data of listbox but want to store values of 1st list. )  
    ID Selected Countries
    1 Country 2, Country 3, Country 4
    2 Country 1
  • 05-11-2012 05:29 AM In reply to

    • Sneha
    • Not Ranked
    • Joined on 05-11-2012
    • Posts 2

    Re: writing values from a multiple-selection list box to another control

    hi

     Can any body help me I am facing one issues related to multiple selection list box.

    Is it possible to set rules on a multiple selection list box that are dependent on a drop down control?

    Example: if in dropdown I select America then on multiple selection list box countries under america should be displayed.

     thak you in advance

  • 05-11-2012 05:49 AM In reply to

    • Sneha
    • Not Ranked
    • Joined on 05-11-2012
    • Posts 2

    Re: writing values from a multiple-selection list box to another control

    Is it possible to set rules on a multiple selection list box that are based on a drop down control.

    Example if I select america on dropdown it should the countries related to america on the multiple selection list box.

     

    Thank you,

    Sneha

     

  • 05-11-2012 09:47 AM In reply to

    Re: writing values from a multiple-selection list box to another control

    It sounds like you want a cascading list box.  This can only be done with the "client" and not as a web form (at least in 2007 InfoPath), but if you want to look at it, you can go to the "Microsoft Office InfoPath Help" menu and search for "cascading list box" and it will give you the instructions.  I have done this using these instructions and it worked well (again, we are using 2007 right now).  Hope this helps you.

    Nalani

  • 08-13-2012 09:10 AM In reply to

    Re: writing values from a multiple-selection list box to another control

    Hi Jimmy, I had a similar requirement and was trying to use your formula, but when I am trying to filter the field1 , I am getting an error message as shown in the attached image. Please let me know if I am missing anything. Thanks,
Page 2 of 5 (73 items) < Previous 1 2 3 4 5 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.