remove duplicate entries in sharepoint list..help! - InfoPath Dev
in

InfoPath Dev

remove duplicate entries in sharepoint list..help!

Last post 06-13-2008 08:21 AM by [email protected]. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 04-11-2007 02:46 PM

    remove duplicate entries in sharepoint list..help!

    hello everybody,

    i just started working with infopath03 and encountered some difficulities;

    i want be able to select contacts from the sharepoint contact-list in a form using two dropdown boxes; the first one for the company and the second one for the name.

    the problem occured as i tried to remove the duplicate entries in the first dropdown box doing as described in this tutorial:http://www.infopathdev.com/howto/tutorials/default.aspx?i=51dce616335a4ff6a78f2d289baf4651 (and similar)

    where i used the something like:
    not(. = ../preceding::Contacts/@Company)


    and well, it just did not work. of course i tried to puzzle out a working filter rule altering the path after the "::" but nothing worked out. >__<

    can anyone help me or give me a hint where to continue reading?

    (btw: yes, i don't really understand the whole 'my:' thing in infopath, is there a tutorial or so on this topic? )

    greetings

    fabian
  • 04-12-2007 01:20 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    Hi

    I think the problem is because you did give 'my' prefix in the xpath of the field.

    'my' is a autogenerated default Namespace Prefix in InfoPath.

    So you have to use this

    not(. = ../preceding::my:Contacts/@my:Company)
    Madhuri
    http://www.ggktech.com
  • 04-13-2007 02:21 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    thanks! i think that's a version i haven't tried yet..

    can you tell me anything about the purpose of those 'my'-statements? .. i know perl and stuff, but i don't really get why and when we need those in infopath.. and why do i need it when integrating a sharepoint list, but not when i use an xml-file?
  • 04-13-2007 02:40 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    Hi galiumarsenide,

    Generally we use number of namespaces in different languages based on their requirement. Likely 'my' is the prefix of InfoPath which stores the name space of the InfoPath. Like wise InfoPath will generate different name spaces with different prefixes.

    Generally we use directly the methods or events any thing by declaring the name space once. Here in InfoPath the Prefix is used to differentiate what this Xml DOM or XPath belongs to.
    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 04-17-2007 04:26 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    meh.. it does not work. >___<

    even with your expression it still displays all entries without any filtering done. .. wargh.
    new approaches?

    bleh.. and other problems arise:
    i want automatically fill out a repeating section of contact persons with their details using the contact-list on sharepoint. so i tried to do this by selecting company, then last name - whereupon the details are filled out. now, except for that duplicates in the company dropdown-menu aren't filtered, it worked ok. while testing i found out that if i try to add a new contact, there are all possible matches in the last-name dropdownbox, meaning not only the ones for the current entry. (when i've added a person from company abc and select company xyz as i try to add a new contact person, the all contacts that work at company abc and xyz are listed.)

    i tried playing around with those 'my' attributes here again, but it didnt work. i don't know how to address the individual entries in a repeating list..

    i currently don't have any idea how to solve this.. :(

  • 04-18-2007 01:43 PM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    waaaaaaaaaah....
  • 04-18-2007 07:13 PM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    Hi Gallium,

    Sorry for the delay in responding! My guess is that this is an issue with the "." syntax you are using in your xpath. My guess is that you need to use current() function and/or preceding-sibling to make sure you are truly getting the correct parent and doing the comaprison in an utterly sensible fashion. Filtering is tricky and non-intuitive. You are not alone - trust me! If you have a little patience and search some of the blogs, you will find true enlightenment. Here's a start: http://www.infopathdev.com/blogs/greg/archive/2005/07/14/Create-a-Repeating-Cascading-List-from-a-Flat-Data-Source.aspx. Greg has other posts regarding current. Search the blogs!

    Patrick Halstead
    Project Manager at Qdabra
  • 04-19-2007 03:53 PM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    aah, thank you! .. i will try that.
  • 05-08-2007 07:29 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    hmm... I still wasn't able to do it.
    in greg collin's example with the cars ( http://www.infopathdev.com/blogs/greg/archive/2005/07/06/Create-a-Cascading-List-from-a-Flat-Data-Source.aspx ) the ancestor-parent of "." is a Repeating Field, where in this sharepoint list it is a Repeating Group (but with attributes).

    i think it should be the same xpath then, but i'm not too sure with groups.. could that be the cause?

  • 05-15-2007 06:15 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    meh...  generally, how does infopath distinguish between a group with attributes (and no subitems) and a field with attributes (and no value)? (both repeating) .. i made some example forms and to me, the xml-structure seems to be exactly the same thing. (but that was a the reason why i couldn't completely reconstruct the problem with a xml file.) namely:

    <Group Attribute1 ="bla"></Group>
    <Field Attribute1="bla"></Field>

     

    but anyway... that doesn't matter too much actually, duplicate entries in dropdown boxes aren't the end of the world. the more annoying problem is the one with the repeating section;

    if one fills out the repeating section and adds another section, the xpaths of the dropdown boxes aren't unique anymore; that means, that the dropdown menus in the new section that contain filtered results now also contain options that match a criteria stated (a preceeding filtering dropdown-menu) in some preceding section. .. so, how can I filter data-sources with a field only from the current section?

    ------------------------- repeating section entry1 --------------------------------¬
    company: [ Microsoft [V]
    name: [ Bill Gates [V]

    contact details: #some-information-from-the-database


    ------------------------- repeating section entry2  -------------------------------¬
    company: [ Apple   [V]]
    name: [ Bill Gates      [#]
              [ Steve Jobs    [  ]   <- that's the open dropdown menu
              [ Steve Balmer [  ]

    contact details: #get-here-as-soon-as-the-name-is-specified

    thanks for your time..

    fabian

  • 06-12-2007 05:35 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    GAWD, DUPLICATE PROBLEM SOLVED! :D

     

    the mistake was simple enough:

    since the Sharepoint Contact List's XPath as a secondary data source looks like this:

     
    /dfs:myFields/dfs:dataFields/dfs:Contacts/@Company

     

    the filter applied must also contain the 'dfs' prefix:

     

    /dfs:myFields/dfs:dataFields/dfs:Contacts/@Company[not(. = ../preceding-sibling::dfs:Contacts/@Company)]

     

    so the expression described in the blog was right all along, there was just this little prefix missing.. darn..

     

    so far so good.. now the fields need to be filled in properly....
     

  • 06-13-2008 08:21 AM In reply to

    Re: remove duplicate entries in sharepoint list..help!

    In infopath 2007 you could also choose the tick box option to show only unique values in the dropdown box properties, no filters required.

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