Help needed creating a filtered dropdown - InfoPath Dev
in

InfoPath Dev

Help needed creating a filtered dropdown

Last post 04-04-2014 05:21 AM by Larry W. Virden. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 03-11-2014 06:27 AM

    Help needed creating a filtered dropdown

    I am trying to create a custom form for a SharePoint 2010 list to be used to request charge codes.

    The user of the list fills in several fields, presses save, and a workflow task email is sent to a group to review the details and determine whether or not the request will be accepted.

    The user specifies a department for whom a charge code is being requested. That department is specified through a dropdown that is bound to a SharePoint lookup.

    The drop down controls are not working properly. It does display all the entries from the lookup list. However, it is forcing the last entry of the list to be selected at all times.

    What would cause that?

    http://wiki.tcl.tk/
  • 03-12-2014 11:03 AM In reply to

    Re: Help needed creating a filtered dropdown

    I have no idea why it was doing that, but after fiddling with properties and xml path settings for a day or two, it appears to have started to work.

    It is frustrating to not understand infopath and sharepoint lists well enough to be able to think in this technology

    http://wiki.tcl.tk/
  • 03-14-2014 12:41 PM In reply to

    Re: Help needed creating a filtered dropdown

    So one helpful soul suggested that I attach the infopath form here so that they could see where things are at. So I just did. I don't know how much use it will be to anyone though. Here are the columns for the sharepoint list for which that infopath is intended. Column (click to edit) Type Required Activity Name Single line of text LAP Code Requestor Person or Group Checked Sponsoring Department Lookup Checked Sponsoring Department:Department Number Lookup Other Departments Lookup Other Departments:Department Number Lookup LAP Code Description Multiple lines of text Checked LAP Code Start Date Date and Time Checked LAP Code Finish Date Date and Time LAP Cost Code Lookup Checked Proposed LAP Code Single line of text Checked Existing LAP Codes Lookup Other Departments:Department Number Single line of text Created By Person or Group Modified By Person or Group
    http://wiki.tcl.tk/
  • 03-14-2014 12:53 PM In reply to

    Re: Help needed creating a filtered dropdown

    Okay, so it is a SharePoint list form, that is good info to have. I know on LinkedIn I was suggesting you drag things over onto the form from the secondary data sources - in an SP List form, you first need to click "Show advanced view" in the fields pane on the right.

    Sponsoring Department and LAP Cost Code are both lookup types - what are their settings in the SharePoint list?

    Hilary Stoupa

  • 03-17-2014 04:09 AM In reply to

    Re: Help needed creating a filtered dropdown

    You asked what the settings were on the two source lists. I am not certain to what settings you are interested.

    Just to make certain that I have updated this thread appropriately - I have tried a variety of suggestions from various sources, trying to get a cascaded filtered dropdown to work from an infopathified custom sharepoint list.

    From time to time the template seems to work, and then doesn't work as I try to resolve issues.

    Today, it doesn't display the filtered options.

    Last Friday, once I select something in the filtered dropdown, the selection was cleared immediately.

    I am back to the drawing board on things this morning.

    Thanks!

    http://wiki.tcl.tk/
  • 03-17-2014 04:18 AM In reply to

    Re: Help needed creating a filtered dropdown

    Per your question about the "source" that my filtered dropdown is using.

    It is a custom list called Cost Codes. It has:

    Department Number - single line of text

    Cost Code - single line of text

    LAP Code - single line of text

    Department Number Cost Code and LAP Code - a calculated column that glues together the other 3 columns into a formated single field.

    The default view is a datasheet view of the first 3 columns.

    In a perfect world, in my single selection dropdown lookup column, I would like to display the calculated column and, when the user selected an entry, have as a value of the control/field the value of the Cost Code column of the list row.

    The Cost Code list is pretty simple. No content approval for submitted items, no versioning on the list,  no management of content types, users are allowed to read all entries, create and edit all entries, no attachments are permitted, no new folder command, results can appear in searches, items can be downloaded (so far - I haven't thought of the ramifications there), items are edited using the data sheet, forms launched in a dialog.

    No validation settings, no rating settings, no audience targeting, automatically managing column indices, no view settings, form customized.

    I don't plan on creating other views on the Cost Code list myself - the users who will be maintaining it can create additional views if they wish to have them.

    Does that cover what you were asking about?

    http://wiki.tcl.tk/
  • 03-17-2014 04:26 AM In reply to

    Re: Help needed creating a filtered dropdown

    Oh - you also asked about sponsering department's lookup.

    Sorry - just noticed when your message was redisplayed.

    Sponsoring department is a single selection dropdown on the department name column of my department numbers and names list. This lookup not only has department name column but also includes the department number column. In this way, it can use the number of the name selected in the lookup. It has the enfoce relationship behavior - cascade delete turned on.

    The department numbers and names list has 3 columns right now (If I can figure out how to use the calculated field in the other dropdown, I'd like to do something similar for this list).

    The columns are:

    Department Number - a single line of text

    DepartmentName - a single line of text

    Division - a single line of text

    The rest of the settings are similar to the Cost Code list, other than I use a standard view rather than a dataview because I didn't think of it when I created the list.

    http://wiki.tcl.tk/
  • 03-17-2014 04:37 AM In reply to

    Re: Help needed creating a filtered dropdown

    I am looking over all the settings this morning, and have a question about something odd.

    As far as I know, I have one rule in all of this app so far.

    The rule inspector shows this:

    Validation

    Proposed x0020 LAP x0020 Code: "Rule 1"

    conditions

    Proposed x0020 LAP x0020 Code != "" and

    contains(Proposed x0020 LAP x0020 Code, string(" "))

    Actions

    ScreenTop: "This field cannot contain string(" "))

    Calculated Default Values

    LAP x0020 Code x0020 Start x0020: now()

    Actions

    None

    Programming

    None

    The first part - the "cannot contain spaces" part - is something that I have been intentionally working on.

    I don't understand that calculated default values. Is that saying that the control is going to put the current time in this field?

    If so, how would I go about changing that? I open the properties for the field - a text box - and there is nothing in the default value field. There is a validation of Cannot be blank checked. There is a limit of 20 characters placed on the field and a left alignment. I fiddled with the size to make it look close to 20 characters.

    I am not certain where the now() comes into play.

    http://wiki.tcl.tk/
  • 03-17-2014 04:45 AM In reply to

    Re: Help needed creating a filtered dropdown

    never mind that last post on the now(). Someone here just pointed out that the field name on the now rule was not the same as the rules on the text field I was working on. They are named too similar, unfortunately. It was a start date field and it indeed does have that out of the box rule.

    Sigh - monday morning, and I don't drink coffee. Maybe I need to start.

    I would delete that last posting if I could - i don't see an option for that on this forum.

    http://wiki.tcl.tk/
  • 03-17-2014 08:28 AM In reply to

    Re: Help needed creating a filtered dropdown

    I should have been more clear.

    The list this form is bound two has these two lookup columns. What are the settings on this list for the lookup columns? If you go to edit the columns, can you take a screenshot of those pages and attach under options?

    If I recall correctly, a lookup will always store the ID of the item and then the list settings will determine what it will display.

    Hilary Stoupa

  • 03-17-2014 11:01 AM In reply to

    I really appreciate your help. I hate that this particular situation seems so complicated. Part of the issue is how to summarize the list and infopath info concisely. I apologize for not just uploading the stuff initially. I had hoped that it was a common issue that others had solved years ago and that I as a newbie was running into for the first time. I have gathered a series of screenshots from the list associated with the infopath that I shared earlier in this thread. The doc holding these screenshots shows all the columns and their types, as well as the edit column information for the ones labeled lookup. The zip file containing that document is attached to this message.
    http://wiki.tcl.tk/
  • 03-17-2014 03:59 PM In reply to

    Re: Help needed creating a filtered dropdown

    Thanks for the screenshots. In general, a lookup column will store the ID of the item in the list we are looking up on. So, that is the first thing I'd make sure of in the form - that in the drop downs for the lookups, the ID field is the Value in the drop down properties.

    Hilary Stoupa

  • 03-18-2014 05:39 AM In reply to

    Re: Help needed creating a filtered dropdown

    Okay, I am confused at this point. Let's use the Sponsored Department lookup as the first example. If I have it returning the ID, then I have no idea how I am going to get the value that I need in the Cost Code control - because it needs the Department Code value of the row that was selected in the Sponsored Department lookup. Obviously I am confused about how this works. I expected to have the return value of the Sponsored Department control be a department number, which I would use in the Cost Code lookup control. In fact, this morning several of the problems I was having are not exhibiting themselves (and I didn't work on things yesterday much other than creating the screenshots for you). There is an odd behavior though. I selected a department for sponsoring, and the cost code filtered out the cost codes used by that department. It did not display them sorted like I thought it would, but it did display them. I selected a department from the Other Department control as well. Everything looked good. I saved the item, and it saved rather than complain. I was really happy. Then, I looked at the list in which the newly entered item was placed. What I see is what I entered on the form. I have attached a screen shot of the two different views. I wonder how I fix this without breaking something else that is working.
    http://wiki.tcl.tk/
  • 03-18-2014 07:26 AM In reply to

    Re: Help needed creating a filtered dropdown

    If the ID is returned then you can populate that in a query on your datasource.  Get the Department code.  Populate that into your Cost Code query then it will only return the values that exist with that Department code.  I would only have the datasource for Sponsored department run when the form opens.  Start the query for each of the other items after the Sponsored Department is selected.  It's mor efficient than filtering on the entire datasource and gets you better results.
  • 03-19-2014 11:34 AM In reply to

    Re: Help needed creating a filtered dropdown

    I don't understand how to "[p]opulate that [i.e. the department code to be obtained from the first list, using the ID from the first list] into the Cost Code query.

    My first control is called the Sponsoring Department lookup.  It is a drop down single selection control. It displays all rows from the Department Numbers and Names and Divisions list. I have that control configured to use for display name the title column (which is the department name), but to use the ID as the value (as was recommended previously in this thread). No filtering was done. The Entries path is: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW.

    When I test this control, I see the department names as expected.

    My second control is intended to show rows from the Departments Cost Codes and LAP Codes list, filtered into just those with the department selected from the first control. It is a single selection dropdown.

    Here's what I tried but it is not working.

    The correct data source, that points to the list I mention, is selected. The entries says this:

     /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Department_x0020_Code = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:Sponsoring_x0020_Department]

    To get that, what I did was select the d:SharePointListItem_RW from the dataFields portion of myFields.

    Within the Filter Data dialog, I selected the Departments Cost Codes and LAP Codes data source, opened the d:SharePointListITem_RW dataField,

    and selected the Department Code parameter.

    I selected the is equal to condition.

    I selected the Main data connection  dataFields > my:SharePointListITem_RW > Sponsoring Department

    When I try it, nothing appears in the drop down.

    Since that is the case, my guess is that in my limited understanding, I selected something incorrectly here in the filter.

    However, I have read various articles and still don't understand exactly what the correct thing to select is, if this is wrong.

    I hope someone can help me understand this better.

    Also, how do I control what datasources run when the form opens? There are 4 lookups in this form and 3 of them need to go at start up and one, which is filtered on the selected department code, would only go once.

    http://wiki.tcl.tk/
Page 1 of 2 (17 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.