Filter Pattern - InfoPath Dev
in

InfoPath Dev

Filter Pattern

Last post 04-07-2006 04:46 PM by Matt Faus. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-07-2006 06:17 AM

    Filter Pattern

    How can I create a filter for a dropdown list so that items ending in 0 are not shown? (I have a 4 digit code and do not want the users to see items such as 9120, but they should see 9121 and 9119)

    Thanks
    Dean
    Charlotte, NC
  • 04-07-2006 12:17 PM In reply to

    You need to use expression in your filter
    not(xdUtil:Match(string(.), "\d\d\d0"))

    First we checking if it is matching and then negating it.
    1. string(.) will give the node value
    2. "\d" means any character and "0" is at the end, means first 3 letters can be any integer and last letter has to be "0"
    3. We are doing an "xdUtil:Match" on this
    4. Negating the total expression, which means we want to omit all the nodes which match the above pattern.
  • 04-07-2006 04:46 PM In reply to

    This would also work:

    not( . mod 10 = 0 )

    This uses the modulus operation to see if the value is a multiple of 10. This would also work for a number of arbitrary size and might perform better than the Match function.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.