0

"Display field only, if" multiple-choice field is = 1

Hi Support

You provided me with the below function if I wanted to display a field only if "multiple-choice field is 1"

choose('multiple choice field',"Value")

I have tried to use this function but I keep getting this error -

Function is not defined: choose(multi,number) at line 1........

Any assistance?

9 replies

null
    • Sean
    • 5 yrs ago
    • Reported - view

    I'm not official support, but the function is chosen(multi, number).

    • Sean
    • 5 yrs ago
    • Reported - view

    For what it is worth, the function chosen(multi, number) returns a Boolean value. So it will return true if field 1 is chosen, but it will also return true if other values are chosen as well as field 1. The way to single out just one chosen value is with this formula

     

    text(chosen(multiField)) = "yourValue"

    • Wael_Hussain
    • 5 yrs ago
    • Reported - view

    Thanks Sean,

     

    That worked!

    • shivenmalhotra
    • 5 yrs ago
    • Reported - view

    WaElisa and Steve

    I'm new to Ninox and am attempting to code a similar Display If Function,can you please share the exact code used in your function? I'm gettign an error when I try and use the function you mentioned above?

     

    Thanks

    • Jorg
    • 5 yrs ago
    • Reported - view

    Hi, 

    You have to replace the multiField with the name of your Multiple Choice field 

    and the "yourValue" with the text that is written in the choice of that field. 

    In other parts the formula is correct, as long as you use also a Multiple Choice field. If you use a simple Choice field please drop the choosen and belonging brackets ()

    Best, Jörg

    • Viggo
    • 4 yrs ago
    • Reported - view

    There is the big weakness with Ninox,---> documentation on NX language and examples DONT EXIST.  Example to illustrate: WHERE in the doc will you find this: "chosen(multi, number)" - refering to "chosen"? Is it part of the syntax?

    • Sean
    • 4 yrs ago
    • Reported - view

    Off-grid, here is a link to the language reference...

     

    https://ninoxdb.de/en/manual/calculations/reference-of-functions-and-language

     

    Use command+f to search for that function on the page.

    • Viggo
    • 4 yrs ago
    • Reported - view

    Here is my (one of them) problem. I try to make a calculation by using a switch function to pull out a text value out of a multi-choice field, do the calculation and put the result into another field. Problem is to pull out that value. I've seen some use of brakets in the forum, but NONE in the language referense. That is what I mean by saying language reference i somewhat useless.

    • Sean
    • 4 yrs ago
    • Reported - view

    That would be quite a switch statement. I'm not a math wiz, but there would a lot of possible combinations with just 5 items in your multiple choice field.

     

    You would use the chosen() function to get the selected values of the multiple choice field. It returns an array with the values. You can also use the numbers() function to get an array of the chosen item's index.

Content aside

  • 4 yrs agoLast active
  • 9Replies
  • 4576Views