Skip to main content
hema.mathivathanan
July 21, 2023
Question

if nested

  • July 21, 2023
  • 12 replies
  • 0 views

Hi. I have a doubt in nested if's

here, if the first condition is true, then it will be return the statement "should be 18 digits". If it's false, I want null value to be returned. Since  I am using nested if's its returning "must be numerical and no more than 12no's". how can we resolve this. Can someone help me here?

    12 replies

    harshj0001
    July 21, 2023

    Hey,
    If you simply want to return null for false then instead of using second if, just replace it by null.

    hema.mathivathanan
    July 21, 2023

    I need the second if too.

    mikes0011
    Brainy
    July 21, 2023
    I need the second if too.

    But that's not what you said in your description.

    The Expression Guru
    sarathkumr268295
    July 21, 2023

    Can you tell what are you trying to check in the first and second and conditions?? 

    you can try swapping the if conditions and check it out. It might help. it could be something like

    if(

    and(),

    "must be numerical and no more than 12 numbers",

    if(

    and(),

    "should be 18 digits",

    {}
    )

    )

    hema.mathivathanan
    July 21, 2023

    In those conditions I am checking the length of the field based on the input

    sarathkumr268295
    July 21, 2023

    try something like this

    csteward
    July 21, 2023

    It would help if you can describe what you are trying to accomplish (e.g., when should "..no more than 12 numbers" show?), and expand your and() statements. 

    Currently, your empty array (not null technically) would be returned in the situation where the first if() evaluates false and the second if() evaluates to true.