format a string and add a space. - InfoPath Dev
in

InfoPath Dev

format a string and add a space.

Last post 02-03-2015 06:43 PM by Bre Huston. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-02-2015 11:59 PM

    format a string and add a space.

    Hi, I have a field where he user enters a UK Vehicle Registration number in the format AANN(space)AAA where A is a letter and N is a number. It will strictly remain in this format.

    Some users will enter the data without the space and this will cause lookup rules to fail.

    Using concat and substring, I am trying to search the string for a space at exactly the 5th character and if one is not present, insert it.

    I am also using translate to force the string into caps as this also is required for the lookup.

    Here is what I have for the translate() section, I just don't know whereto start for the spaces.

      translate(Vehicle Registration, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

    Any help would be greatly appreciated.

     

    Dave 

     

     

    Filed under: , ,
  • 02-03-2015 06:43 PM In reply to

    Re: format a string and add a space.

    Hello Dave,

    An easier method may be to use 2 helper fields and concatenate them in a third field. The first field would be limited to 4 characters and the second would be limited to 3. Then set actions that when both fields are not blank, set the third field to concat(field1, " ", field2). I would still use the translate function on both fields so that you get the corrected values.

    Hope that helps!
    Bre 

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