Switch Case statement in Ninox

Another great structure in Ninox that can help you in the automatization of your processes is a Switch Case statement. Simple syntax, fewer lines of code, and faster result in your app. 

Please check the video with samples, and read below about the keywords & syntax:


switch ... do - is an opening word

case -  is used to select one of many code blocks for execution

default -  used to specify the code executed when the expression does not match any test case (optional)

end - obligatory


switch ChoiceField do
case 1:"Monday"
case 2:"Tuesday"
case 3:"Saturday"
case 4:"Sunday"
default:"No choice has been made!"

📣 There are some things to be remembered while using switch case in Ninox:

  • Two cases cannot have the same value
  • The data type of variable in the switch needs to be the same as all test cases' values
  • The test case values need not be in order (ascending or descending)
  • Nesting is allowed, but it makes the program more complex

📌 Fewer lines of code are always better!

Have fun with Ninox!

2 replies

    • ninox.1
    • 2 yrs ago
    • Reported - view

    These videos are very helpful!

    I hope you put these videos on the main help site for future reference.

    Well done!

    • Ninox developper
    • Jacques_TUR
    • 2 yrs ago
    • Reported - view

    Thank you Maja.

    In addition, here is an advanced use of the Switch statement : https://forum.ninox.com/t/p8hdmy1

Content aside

  • 2 yrs agoLast active
  • 2Replies
  • 2446Views
  • 6 Following