Default Value Formula Help - InfoPath Dev
in

InfoPath Dev

Default Value Formula Help

Last post 07-15-2010 10:14 AM by fcsech. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-15-2010 08:58 AM

    • fcsech
    • Not Ranked
    • Joined on 07-15-2010
    • Posts 6

    Default Value Formula Help

    Hi guys, hope you can help. I'm working on a form and I am having trouble coming up with a formula for a default value for one of my fields. What I want the formula to do is only capture a few values/characters based on their position. For example, I want the formula to only capture "4.0" in the following text "EDAM Residents - 8 hours (4.0 cr)", and only "2.0" in "PALS - whole day (2.0 cr"). I've tried the substring function but I need it to start counting from the end becuase every selection is formatted(same # of spaces) at the end and not every instance is the same # of characters. I tried this concat(substring-after("("), substring-before(")") but got:

    Expected value type: ,

    Actual value: end-of-string
    concat(substring-after("("), substring-before(")")<--

     

    -Frank

  • 07-15-2010 10:04 AM In reply to

    Re: Default Value Formula Help

    You're not indicating the field in your substring statements, and they need to be nested in order to do what you want:

     substring-before(substring-after(field, '('), ')')

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-15-2010 10:14 AM In reply to

    • fcsech
    • Not Ranked
    • Joined on 07-15-2010
    • Posts 6

    Re: Default Value Formula Help

    Works great Jimmy! Appreciate the help
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.