Highlight duplicate entries in a repeating table - InfoPath Dev
in

InfoPath Dev

Highlight duplicate entries in a repeating table

Last post 10-07-2014 02:22 AM by donstephen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-05-2014 11:44 PM

    Highlight duplicate entries in a repeating table

    Hi,

    I am a newbie to InfoPath forms. I have an InfoPath 2010 form receiving a list data from SharePoint 2010. I want to highlight the duplicate names in the list with a different colour in InfoPath repeating table. While searching in Google, I found the below formula for counting the duplicate entries in a list. I tried applying the formula to a separate text field and I was getting the below error.

    Formula

    count(../my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[text() = ../preceding-sibling::*/my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title/text()]) + count(../my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[text() = ../following-sibling::*/my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title/text()])

    Error I am getting while inserting the above formula to a text field

    Expected value type: ,

    Actual value: :
    count(../my:xdXDocument-->:<--GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[text() = ../preceding-sibling::*/my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title/text()]) + count(../my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[text() = ../following-sibling::*/my:xdXDocument:GetDOM("Test123abcd2")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title/text()])

    Please help me with the correct formula for my above requirement or how to resolve the above error.

    Thanks

    Rajesh


  • 10-07-2014 02:22 AM In reply to

    Re: Highlight duplicate entries in a repeating table

    Hi RC_Amma,

    It looks like you do not need to use the whole xpath. Please try this formula instead:

    count(../d:Title[text() = ../preceding-sibling::*/d:Title/text()]) + count(../d:Title[text() = ../following-sibling::*/d:Title/text()])

    Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.