# Multiple If's Else if's

**URL:** <https://community.silverfin.com/t/multiple-ifs-else-ifs/1857>\
**Category:** Insights\
**Created:** [July 31, 2020, 12:43pm UTC](https://community.silverfin.com/t/multiple-ifs-else-ifs/1857 "2020-07-31T12:43:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![faybordbar](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@faybordbar](https://community.silverfin.com/u/faybordbar)\
**Post date:** [July 31, 2020, 12:43pm UTC](https://community.silverfin.com/t/multiple-ifs-else-ifs/1857/1 "2020-07-31T12:43:24Z")

</div>

Hi  
I am trying to work out how to create a nested IF statement.  
e.g.  
{% If custom.text.box == ‘A’%}  
_Case A_  
{% else if custom.text.box == ‘B’ %} -\> This is the part that doesn’t work  
_Case B_  
{% else %}  
_Case C_  
{% endif %}

Is this possible with the if formula or do I need an alternative one?

Thanks  
Fay

---

<div class="post-metadata">

**Author:** ![Daria\_Bobukh](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/daria_bobukh/32/1077_2.png) [@Daria\_Bobukh](https://community.silverfin.com/u/Daria_Bobukh)\
**Post date:** [July 31, 2020, 2:17pm UTC](https://community.silverfin.com/t/multiple-ifs-else-ifs/1857/2 "2020-07-31T14:17:21Z")

</div>

Hi @faybordbar,

Welcome to the Silverfin community! Hopefully you will find a lot of useful information here and on our developer website: [https://developer.silverfin.com/docs](https://developer.silverfin.com/docs).

As for your question, when you create an `if` statement (or any other control flow statement, [https://developer.silverfin.com/docs/control-flow](https://developer.silverfin.com/docs/control-flow)) there are a few thing to bare in mind:

1. No capitalisation should be used in keywords (in this case no capitalisation of `if`);

2. There is a keyword `elsif` which is one word (used for your second statement);

3. Please do not use reserved words in naming your variables, functions, labels (for example `text` since it is a variable type in liquid). You can call it `some_text` or `text_1`, etc. Useful link: [Naming variables](https://developer.silverfin.com/docs/liquid-specific-topics#section-naming-variables)

4. nested `if` statement is an `if` statement **inside** which there is another `if` statement (an example provided below, usually different logic is checked in each statement):

Let us know if you need any more help or if you have any more questions. And good luck in your coding journey!

Regards,  
Dasha
