Setting a Multi Selection Listbox using Rules - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Setting a Multi Selection Listbox using Rules

Last post 04-06-2016 06:46 AM by Kaoru Okumura. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-31-2016 10:35 AM

    Setting a Multi Selection Listbox using Rules

    Hi all, I have an InfoPath form with a data connection to another list (List B). List B has a checkbox field that I'm pulling in into a repeating table. I also have a multi selection listbox that has a separate lookup to the same List B. The repeating table data connection will be re-queried multiple times in the form, while the other will stay as-is. I'd like to make it so that when the checkbox in the repeating table is checked, it also checks off the matching value in the multi selection listbox. Unfortunately, the rule I've made on the repeating table checkbox applies only one value to the multi selection listbox. For example, If I click one checkbox in the repeating table, it selects the appropriate value in the multi selection listbox. However, if I select another checkbox in the repeating table, it will overwrite the previous selection in the multi selection listbox and just select the most current value. Is there any way to "concatenate" a value onto a multi selection listbox using an InfoPath rule? Let me know if I'm not making any sense here. I'm more than happy to clarify if needed. Any help would be extremely appreciated. Thanks!
  • 04-04-2016 12:20 AM In reply to

    Re: Setting a Multi Selection Listbox using Rules

    Hi, I am not sure about the relation of checkbox in list, and the second "multi selection listbox"

    Given that List B has checkbox field, I assume the column type of the SharePoint column should be True/False. On the other hand, multi selection list box in the form allows selecting multiple options, which is a special kind of repeating fields.

    Contaminating true and false into multi selection list box does not seem what you want --- I wonder if you mean SharePoint list B has 'choice' which can be selected from specified list... You can also attach your form using Option tab. which version of InfoPath are you using? and can we assume the form you are creating is SharePoint library form (i.e. not SharePoint List Form)? thanks,

     

  • 04-04-2016 07:07 AM In reply to

    Re: Setting a Multi Selection Listbox using Rules

    Hi Kaoru - thanks for the response.

    When the checkbox from List B is checked in the form, I am setting the multi selection listbox to equal that List B item ID that was just checked.
    The multi selection listbox has a separate data connection to list B as well. It has a value of each list B item ID, and a display value of the item title.

    What I'm looking to do is have a "query" data connection where the user can search for multiple items in List B, and then select the items they want to include in the current form.
    The items that have been included in the current form from list B should be stored in a format where later on I can re-query them to get more detail about them from list B.

    I don't know how to re-create this since I'm using a lookup in the form and the SharePoint server is secured.
    I am using a SharePoint list right now, however, if needed, I can use a Form Library.

    I've included screenshots to try to help.
    Hopefully this provides a little bit of clarity...
    Let me know if it's still not making sense.

  • 04-06-2016 06:17 AM In reply to

    Re: Setting a Multi Selection Listbox using Rules

     Hi, thanks for the image, now I understand your needs.

    Please check attached sample form (SharePoint 2010 Browser form). Instead of SharePoint list, this has static xml mimicking SharePoint list, so that you can see preview without any deployment.  Rules to handle Add Item are set to the fields:  

    • Checkbox field of the first secondary data /FormLogic/row/check: save which ID's checkbox is clicked. and set trigger
    • Dummy (for trigger) on the second secondary data /FormLogic/row/dummy: kicked by trigger, and set checkbox On if this row has the same ID

    You may want to rules for 'uncheck'. For your information, this just temporary update checkbox in the form and does not update SharePoint list. In case you need to update SharePoint list side, I'd recommend using Qdabra qRules SubmitToSharePointList feature. 

    Also added how to create concatenated string of ID of which checkbox is selected. you can save it into form :-)  

  • 04-06-2016 06:31 AM In reply to

    Re: Setting a Multi Selection Listbox using Rules

    Thanks Kaoru! I appreciate this a lot!!

    Just curious - If I need to re-query each ID in the concatenated string when the form is re-opened (to get the title of each concatenated ID), what would be the best way to do that?
  • 04-06-2016 06:46 AM In reply to

    Re: Setting a Multi Selection Listbox using Rules

    Easiest option is, keep Title in concatenated string. sample 1 - Title 1; 2 - Title 3;
    Default value formula would be:

        eval(eval(row[check = "yes"], 'concat(ID, " - ", Title, "; ")'), "..")

    Re-quering multiple IDs based on concatenated IDs may not so simple. if it still ok, I'd set show and hide rule of repeating table of all list item (assuming list item number is not so huge) --  with condition that the ID is substring of Concatenated ID.  you may use '[1]' or so instead of '1;' so that substring match does not math unexpected one such as 21;.   

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.