Populating a Multiple Selection Listbox - InfoPath Dev
in

InfoPath Dev

Populating a Multiple Selection Listbox

Last post 08-28-2009 11:38 AM by Jess573. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-25-2009 08:16 AM

    Populating a Multiple Selection Listbox

    I have a form where I need to populate a list of users with their UserID's based on a selection in the form.  I am able to populate the username, but when I concat the UserID, it will not repeat for all users.  (Basicaly, instead of it showing all users with userID's that meet the criteria, it will only show the first one. 

    Any suggestions?

  • 08-26-2009 03:22 PM In reply to

    Re: Populating a Multiple Selection Listbox

    Hi --

    I could use a bit more detail to understand the issue. What are you doing to populate your list? Is your 'list' a repeating section in the main data source of your form? Is the data you want to populate the list with from a secondary data source?

    Hilary Stoupa

  • 08-27-2009 07:04 AM In reply to

    Re: Populating a Multiple Selection Listbox

    The data I'm using to populate the list is from a secondary data source.  As far as weather or not the list is a repeating section in the main data source...I'm going to guess no.  I've tried it multiple ways.  See below for the form contents.  All of the dropdown lists are populated from a SQL DB and each selection determines what selection is available in the next ddl. 

    When I try to populate the Multiple-selection list box based on the following filter, it populates everything fine. The rule states to populate the field with all instances of 'EmployeeName' where 'Role Affected' = 'Role'.

    However, the rule I use to include both the EmployeeName and UserID does not work.  See below:

    concat( @EmployeeName[RoleAffected = @Role], @UserID[RoleAffected = @Role])

    This only returns the first occurance of EmployeeName - UserID.   Is this enough info?

    Division:
    Department:
    Role Affected:
    Role Owner(s):
    Role Members:
    USER NAME
     
     
     
     
  • 08-27-2009 09:33 AM In reply to

    Re: Populating a Multiple Selection Listbox

    Do you mind attaching your template to a reply (under the Options tab you can upload a file). I'm still having a little trouble understanding what you are trying to do.....

    Hilary Stoupa

  • 08-27-2009 11:28 AM In reply to

    This is a test version of the actual form.

  • 08-27-2009 12:33 PM In reply to

    Re: Populating a Multiple Selection Listbox

    Thanks, that makes it easier. Please correct me if I am wrong, but it sounds to me as if what you are trying to do is populate field46 in your Main Data Source with all the UserId values from the vwAccessWithEmployeeName data source. Unfortunately, InfoPath won't do that out of the box. Really, though, if all you need is to make sure the options in the multi select list box bound to field46 are only ones where the Role equals the selected Role Affected, you can do that with filtering on the control, not rules.

    As I look further, it looks like you have already filtered that list box to display only items that have the same Role as the selected Role Affected. Are you also wanting them all to be selected by default?

    Hilary Stoupa

  • 08-27-2009 02:11 PM In reply to

    Re: Populating a Multiple Selection Listbox

    What I want is the each selection in the listbox to contain the EmployeeName + UserID (rather than just the Employee Name).    I can get it to display the Employee name based on the criteria of "Role Affected", but I can't get the UserID concatenated to it. 

  • 08-27-2009 02:29 PM In reply to

    Re: Populating a Multiple Selection Listbox

    I finally understand!

    Thanks for being patient, I really didn't get what you wanted to do. You need to change your data source. You can't use a formula for the display values in the list box. I'm guessing from the name of your vwAccessWithEmployeeName datasource that it might be a view -- add another column to your SQL view that concatenates the Employee Name and User Id. You should be able to use EmployeeName + ' ' + UserId to get a result that displays EmployeeName, a space, and the UserId.

    Hilary Stoupa

  • 08-28-2009 11:38 AM In reply to

    Re: Populating a Multiple Selection Listbox

    Such a simple solution!  (I didn't realize you could concat data within a column in SQL). Fixed my problem.  Thanks. 

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