Conditional statement in infopath for a field - InfoPath Dev
in

InfoPath Dev

Conditional statement in infopath for a field

Last post 03-11-2015 08:20 PM by Manju. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-10-2015 08:53 PM

    • Manju
    • Top 500 Contributor
    • Joined on 02-26-2015
    • Posts 28

    Conditional statement in infopath for a field

    Hi can we use a if else condition for a field to get the default values, if so can u correct the below statement. To get the end date based on today() date example: if (substring(today(), 6, 2) = "04" or substring(today(), 6, 2) = "06" or substring(today(), 6, 2) = "09" or substring(today(), 6, 2) = "11") then concat(substring(today(), 1, 7), "-30") else if (substring(today(), 6, 2) = "01" or substring(today(), 6, 2) = "03" or substring(today(), 6, 2) = "05" or substring(today(), 6, 2) = "07" or substring(today(), 6, 2) = "08" or substring(today(), 6, 2) = "10" or substring(today(), 6, 2) = "12") then concat(substring(today(), 1, 7), "-31") else concat(substring(today(), 1, 7), "-28") end if Thanks, Regards, Manju
  • 03-11-2015 09:28 AM In reply to

    Re: Conditional statement in infopath for a field

    Hi Manju,

    There are different approaches to achieve this but what I would simply do is create two action rules. The first rule would follow the first condition and set the target field to the desired value. You can check tick the checkbox for "Don't run remaining rules if the condition of this rule is met" in case the second rule's condition would have conflicts with the first one.

    Note:

    You might need to use an expression similar to this if you have the rules on the same field:

    substring(xdDate:Today(), 6, 2) = 04 or substring(xdDate:Today(), 6, 2) = 06 or substring(xdDate:Today(), 6, 2) = 09 .... and so on

    I'm not sure how your form is configured but this logic should be able to work.

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 03-11-2015 08:20 PM In reply to

    • Manju
    • Top 500 Contributor
    • Joined on 02-26-2015
    • Posts 28

    Re: Conditional statement in infopath for a field

    Hi Donstephen thanks for ur reply. Will give a try using expression. Regards, Manju
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.