Filtering: What am I doing wrong? Unique selection needed. - InfoPath Dev
in

InfoPath Dev

Filtering: What am I doing wrong? Unique selection needed.

Last post 11-05-2015 07:35 AM by Hilary Stoupa. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-17-2015 05:50 AM

    Filtering: What am I doing wrong? Unique selection needed.

     I've been trying to fix this literally for 2 full days, and have been unsuccessful. You all are my last hope!

     Here is the basic setup. 1 list with infopath, 1 data connection to a list with ~3k items.

     2 dropdowns on the form. One for a name and one for a location (all pulling from the single data connection).

     The user will select a name, then the location dropdown will have up to 2-10 different selections. All that works fine, I have the filters working.

    *** What I can't get working is once a name is selected (and the form saved) then that user can't be selected again.

     IE:

    Dropdown:

    Joe
    Mary
    Lisa
    Frank

    If I select Lisa, and save the form, and open a new form I need to only see:

    Joe
    Mary
    Frank

    I tried making a new data connection to the infopath list, and doing a Name does not equal Name, but that doesnt work. It still shows all the values. But what is strange is that if I do Name = Name, only the values selected show up. I don't know why Not Equals doesn't work.

    Does anyone pleaseeeee have any idea how to fix this? I figured it would be a common thing but I've searched for hours and found nothing. A HUGE thank you in advance!

  • 09-17-2015 09:24 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Yah, I think the expression needs to be modified manually. Can you open the filter dialog and set it up with Name = Name, then click the first drop down and set that to "The expression" then copy out the XPath that appears and paste it in a reply?
    Hilary Stoupa

  • 09-21-2015 10:18 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Here is what it shows.

    . = xdXDocument:GetDOM(Infopath Main")/dfs:myFields/dfsdfs:dataFields/d:SharePointListItem_RW/d:Title

  • 09-21-2015 10:29 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Can you try replacing that expression with this one? not(xdXDocument:GetDOM("Infopath Main")/dfs:myFields/dfsdfs:dataFields/d:SharePointListItem_RW[d:Title = current()])
    Hilary Stoupa

  • 09-21-2015 11:23 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     I had a typo in my expression - I cant do a copy/paste as I'm using a separate computer - anyway.

      I used:

     not(xdXDocument:GetDOM("Infopath Main")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Title = current()])

     This is returning all of the values like the Name = Name does. Can this be switched to Name NotEquals Name?

  • 09-21-2015 11:34 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Can I see a copy of your form? Under the Options tab you can attach a file.
    Hilary Stoupa

  • 09-21-2015 11:38 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     I can't, its on a corporate internal network not connected to the net. :(

     I tried it on a test list as well with the same issue, only takes a minute to set it up. Maybe I can back up and you could look at my process to see if I have something wrong this way?

    List 1: Data
    - add dummy data, Joe, Lisa, Frank, Ted

    List 2: Infopath list
    - Add datasource to list 1 Data, columns Title selected
    - Add datasource list 2, columns Title selected
    - Add dropdown. Selection filter to Data. Name is not equal to (data source 2, select Title)
    - Add a record of Joe

    If I do that and run it, I get nothing instead of expecting to see Lisa, Frank, Ted.

    If I set it to equal I see only Joe. If I set it to Not Equal I see everyone, including Joe who should be filtered out.

  • 09-21-2015 11:42 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Okay. Is "InfoPath Main" the data source for your dropdown?
    Hilary Stoupa

  • 09-21-2015 11:52 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     Yes. I have

    Name (going to the data list, dataFields: d:SharePointListItem_RW:Name) NotEquals Name (going to data connection to the current list,  dataFields: d:SharePointListItem_RW:Name)

     I edited my response above to show a little more my process in doing this. Thanks for you help in looking into this!

  • 09-21-2015 11:52 AM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Okay, I had this wrong - http://www.infopathdev.com/blogs/matt/archive/2006/05/23/Filter-a-Repeating-Drop_2D00_Down-List-on-Previous-and-Future-Selections.aspx got me squared away. What is the full XPath to the field bound to the dropdown? You can right click the field in the Fields task pane and select Copy XPath.
    Hilary Stoupa

  • 09-21-2015 12:08 PM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     /dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:Select

  • 09-21-2015 12:13 PM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Try this? not(d:Title = current()/preceding-sibling::my:SharePointListItem_RW/my:Select)
    Hilary Stoupa

  • 09-21-2015 12:28 PM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     Still shows all of the items. For now I've put a workflow in place that sets a 'Selected' field in the data list and I'm filtering off that. I'll have to play with this more tomorrow, again thanks for your help.

  • 09-21-2015 12:49 PM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

    Cool. I'll put a sample up later today that uses an XML data source for the dropdown so you can see how the general idea works in a sample.
    Hilary Stoupa

  • 09-21-2015 12:58 PM In reply to

    Re: Filtering: What am I doing wrong? Unique selection needed.

     Found one more approach:

    not(d:Title = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:Select)

    I've also attached a sample based on this thread. 

    Hilary Stoupa

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