Solved

Nested IF statment in SmartForm rules

  • 7 November 2014
  • 5 replies
  • 73 views

Badge +4

I am tryng to create a nested if statement for a form that will allow me to have a top level IF statment with a bunch of sub level IF statements within it. 

For example:

 

IF(viewcontrol = 0)

{

    IF(param = "a")

    {

        Do Something

    }

    ELSE IF (param = "b")

    {

       Do Something

    }

    ELSE IF (param = "c")

    {

       Do Something

    }

}

 

That is what i am trying to achieve but the best I can do is something like this:

IF (viewcontrol = 0)  AND IF (param = "a")

{  

   Do Something

}

IF (viewcontrol = 0)  AND IF (param = "b")

{  

   Do Something

}

IF (viewcontrol = 0)  AND IF (param = "c")

{  

   Do Something

}

 

Is it possible to create a nested if like the first example i have listed?

icon

Best answer by Kran 26 May 2017, 13:51

View original

5 replies

Badge +10

Hi,

 

I would create several data labels each containing one of your sub level if statements.

You can then create the if expressions on these data labels and assign their values as True/False.

 

Where you want to perform actions, combine these data label results as you desire.

 

I hope this makes sense.

Let me know if anything is unclear.

 

Regards,

JohanL

Userlevel 2
Badge +9

Dear PBear74,


Nested If statements for rules in SmartForms is on the roadmap for a future update (hopefully 4.6.10).


Thanks, and regards,


Gail

Badge +4

Thanks for the heads-up, I started looking here because I was trying to nest a couple of If(s).  I did not know that its not possible yet.  Thanks again for this post.

Badge +2

Has this been resolved?  I'm trying to do the same as below but can't seem to accomplish it with an unbound rule.

Badge +9

Hi Pbear74,

 

      you can use unbound rule to achive this,  refer below link for more on this.

 

 

Let me know if this helpsd you.

 

 

Reply