Extracting Numbers from a field - InfoPath Dev
in

InfoPath Dev

Extracting Numbers from a field

Last post 03-27-2014 01:40 AM by donstephen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-20-2014 07:30 AM

    Extracting Numbers from a field

    I have a username field that contains both letters and numbers.  I have another field (number type) that extracts the numbers from the username field.  The username field contains a variable number of characters.  The numbers can be located in any position in the username field.  If the last two characters in the username field do not contain numbers I want to make the number type field equal to 0.

    Is this possible??

  • 03-27-2014 01:40 AM In reply to

    Re: Extracting Numbers from a field

    Hi roadman1977,

    Welcome to InfopathDev

    I would suggest using a formula such as the one below. What it does is that it returns the last two characters of a string, and from there use a rule which is triggered by a condtion that if the populated field is not equal to numbers, then set a certain field to a value of 0.

    substring(field1, string-length(field1) - 1, 2)

    where field1 is the username field.

    Please let me know if 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.