0

Revealing some field according to Multiple Choice selections

Hi there,

I've created a form with a Multiple Choice field consisting of 5 choices and some hidden fields (check mark). I want these hidden fields to appear whenever the 5th choice is among the other choices or whenever I only choose the 5th choice. (The selection possibilities are 5, 1-5, 2-5, 3-5, 4-5, 1-2-5, 1-3-5, 1-4-5, 1-2-3-5 and 1-2-3-4-5). In order to achive this I created a formula field to get the index number for every selected choice so that I can make the calculation by simply entering the following code;

number(Multiple choice)

However the Formula field returned with the following results;

For 1st choice I get = 1

For 2nd choice I get = 2

For 3rd choice I get = 4

For 4th choice I get = 8

For 5th choice I get = 1 (one NOT 16)

So;

When choose 1 AND 5; I got 9 (1 + 8) 

When choose 2 AND 4; I got NOTHING instead of 10

When choose 3 AND 4; I got NOTHING instead of 12

When choose 1 AND 5; I got 11 instead of 9

When choose 3 AND 5 I got 41 instead of 20 (which is 4 for 3rd choice beside with 1 for 5th choice)

When choose 1 AND 3 AND 4 AND 5; I got NOTHING instead of 27

etc...

I beleive there is something wrong with the Return Values of Multiple choice field. If I could be able to sum up the return values, I can unhide the hidden fields by simply checking the Multiple Choice Field's return value (entering a simple script in the "Display field only, if section").

Please advise,

Thanx in advance...

Emre

4 replies

null
    • Mconneen
    • 6 yrs ago
    • Reported - view

    Not sure how you got your values..   I think we are also mising apples / oranges.   First 

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

    number(value) has a bullet that says.. If value stems from a choice field, this will be the choice’s internal id. Use number(text(choice)) to get a numeric representation of the choice’s text.

    In your case .. it is a multiple choice field... so I would expect it not to work.     Also.. for me.. for a single choice.. I had to use number(choice) .. 

    • michaeltoc
    • 5 yrs ago
    • Reported - view

    For the hidden fields, put the following in the "Display field only, if:" box

    let a:=text('NameOfMultiChoceField');

    contains(a,"NameOf5thField")

     

    Michael

      • CAPTAIN_WEST
      • 1 mth ago
      • Reported - view

       Worked thank you

    • emrekolday
    • 5 yrs ago
    • Reported - view

    Hi Michael,

    Thanks for the tip. I am working on another project (with another app) for the moment. I'll try it as soon as I get my hands on Ninox again.

    Thanks & regards,

    Emre

Content aside

  • 1 mth agoLast active
  • 4Replies
  • 2776Views
  • 1 Following