0

Querying multiple choice fields

Does Ninox script have a "contains" function?

I have a simple multiple choice field in which up to four options can be selected. In effect what I want the user to be able to do is filter records so that all those that have option A selected in that multiple choice field are listed together (no matter what other options are or are not selected) and likewise with options B, C and D. It seems to me I should be able to create an if/theh/else formula field that shows "all records where the multiple choice field contains A" - but I'm not sure how the contains function is scripted or even whether it exists! 

5 replies

null
    • Birger_H
    • 6 yrs ago
    • Reported - view

    The funcion works like this:

    if contains(chosen('your mulple choice field'), "A") then ... else ... end

    Birger

    • David
    • 6 yrs ago
    • Reported - view

    OK, thanks Birger. That's helpful. Maybe add these functions to the Manual?  

    • David
    • 6 yrs ago
    • Reported - view

    This doesn't seem to work, though:

    if contains(chosen('STORY TYPE'), "Humanitarian work") then "Humanitarian work" else null end

    It returns "Function is not defined ... column 59". Adding text("H...) doesn't make any difference.

    • blackie
    • 6 yrs ago
    • Reported - view

    if contains(text(chosen('STORY TYPE')), "Humanitarian work") then
    "Humanitarian work"
    else
    null
    end

    • David
    • 6 yrs ago
    • Reported - view

    Brilliant. That does the trick. Many thanks!

Content aside

  • 6 yrs agoLast active
  • 5Replies
  • 3233Views