formulas - InfoPath Dev
in

InfoPath Dev

formulas

Last post 06-14-2013 08:50 AM by agorman. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-13-2013 02:59 PM

    formulas

    I am very new to InfoPath and am trying to understand the FX functions. I have a field that want to propagate with a a reference code made up of: the first, second and last letter of the users surname, plus first 3 letters of the data from another field, plus the current time. For example, if the surname was Williams, and the other field I want to use had the data 'BASIC' in it, and the time was 09:23 , - then the result would look like this WISBAS0923 - is this possible to do. I have tried different variations in the formula section but without success. Thanks Angie
  • 06-14-2013 02:28 AM In reply to

    You 'll need some helper columns I think for this so that you understand what is going on.

    I have a Surname Field
    A data field called ExField
    A current time field

    Break it down into pieces so that you learn and understand how to get what you need.

    Field UserName 2 - to show the first 2 letters of a surname - default value -  substring(Surname, 1, 2)
    Field TTime - to show the now () function with no spaces or T - translate(substring-after(now(), "T"), ":", "")

    put it all together in another field ie RefNumber - concat(substring(Surname, 1, 3), ExtField, TTime)

    I can't get the last letter of a surname (yet). Substring functions in InfoPath rely on you telling the forms how many characters are in a word. Obviously surnames are of different lengths. You could, if this is in SharePoint add a calculated column and it could give you the last letter using and excel function.

  • 06-14-2013 08:50 AM In reply to

     Wow, Thank you for that quick response. I will have a play with this to understand it better - I follow the substring part, but the 2nd line will take a bit of work to comprehend (or maybe not)

    Thank you for the help

    A

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