Conditional Formating for Unique Values - InfoPath Dev
in

InfoPath Dev

Conditional Formating for Unique Values

Last post 10-17-2006 12:36 AM by Matt Faus. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 10-10-2006 03:34 PM

    Conditional Formating for Unique Values

    I have been hunting around and think I am close but I need the exact syntax to get this to work. I have filtered for unique values in drop downs but this is a bit different with multiple repeating fields.

    I have a form linked to a dataconnection to a database. So i want to display my main query results with a filter to show unique names within multiple records in a repeating group.

    myFields
    dataFields
    d:OE
    :Name
    :Plan
    :Amount1
    :NID
    :Etc

    I have the fields in a repeating table within a section and I am using conditional formatting and I want to hide all duplicates by the NID field.
    I think I want an expression which is not(.=..preceding::d:OE/NID) but I do not think my xpath is right.

    Is there some easy way or trick to get the exact xpath for particular fields within Infopath?

    So hopefully someone has done this and can tell me quickly what I am doing wrong and provide a help for someone in the future.

    Thanks
    Clay
  • 10-11-2006 01:06 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Conditional Formating for Unique Values

  • 10-11-2006 05:12 AM In reply to

    Re: Conditional Formating for Unique Values

    As I mentioned I have done this successfully, filtering a drop down list. If "preceding" is what I am supposed to use can you give me some help on my xpath?

    Thanks
    Clay
  • 10-12-2006 08:48 AM In reply to

    Re: Conditional Formating for Unique Values

    I really am stuck here. From what I can tell I have to specify which column to check against, since I am not looking for identical rows but rows with common elements.

    My data structure is
    <dfs:myFields>
    ..<dfs:dataFields>
    ....<d:OE Name="" Plan="" Amount1=0 NID="" Etc="">

    I want to filter my table so unique NID numbers only show up once even though there are multiple records for each NID number.
    Right now in conditional formatting I have
    NID is equal to preceding::OE/@NID
    Hide this Control

    Other conditions work and I have this as the only one right now but I am stuck.
    I have tried both with and with out the @ but I am stuck here and not sure what it is looking for.

    Please help me if you can as this is holding up my whole form implementation.

    Thanks
  • 10-12-2006 08:53 AM In reply to

    Re: Conditional Formating for Unique Values

    Also the explicit xpath is ../preceding::d:OE/@NID

    I think my issue is with the xpath syntax so any help would be greatly appreciated.
  • 10-12-2006 11:17 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Conditional Formating for Unique Values

    Hi Clay,

    Can try once xpath is like “not(.=preceding::d:OE/@NID)”.

    Before trying for above xpath you need to test first of all right side field xpath is correct or not. For this, you can try “d:OE/@NID” xpath is default value for one field and that field which is same level “d:OE” only. If you gets value then our above xpath is correct. By this way you can figure it out where is the problem of your xpath.

    Hope this Help you
  • 10-16-2006 10:14 AM In reply to

    Re: Conditional Formating for Unique Values

    My XPath was correct.

    It has now decided to work.

    NID is equal to preceding::d:OE/@NID
    Hide Control

    Wierd
  • 10-17-2006 12:36 AM In reply to

    Re: Conditional Formating for Unique Values

    Well, congratulations!

    I agree, XPath can be really funky sometimes.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.