0

Working with Multiple Choice Checkbox

Hi,

I have a multiple choice checkbox field in a table (Claim Items) which contains 5 options.
That table is related to another table, Claim, so for each of the items in the claim, I can choose from the checkbox any of the 5 items.

On the Claim table, I need to have a formula field for each of the 5 options in the related Claim Items table checkbox field, which will be TRUE where any of the checkboxes are true.

So for example, if the checkbox on the Claim Items table is listed as "Option1" to "Option5", and there are 8 records, and none of the checkboxes in any of the records are checked, then none of the formula fields on the Claim table would be true.
If you check "Option3" on record 2, and "Option4" on record 7, then on the Claim table, the formula for "Option3" and "Option4" would show as true..

Basically, I need the parent table (Claim) to tell me which options have been chosen in ANY of the related table option multiple choice answers.. I don't need to know which record, but just which of the options have been selected in any of the records.

I've been away from Ninox for a while and struggling to work this out.. especially as the multiple choice values seem to be based on 4 bit patterns rather than 8 bit - so with 5 options in the checkbox, two of the options both return "1" if selected!?

Thanks in advance,

3 replies

null
    • Fred
    • 7 days ago
    • Reported - view

    Have you tried using numbers() to get the choice value of the multichoice field? This way you are working with numbers. Ninox will return an array of numbers.

    Now you can do something like this to search for Option1.

    if contains(unique('Claim Items.numbers(mC)), 1) then
        "Yes"
    end

    So we start inside with the part 'Claim Items'.numbers(mC). Replace mC with your field name. When you create the multiple choice, you will see that a number is assigned to each choice. So we are asking Ninox to give us the choice value selected for each record.

    Then we wrap the whole thing inside a unique as we only need to know if each choice exist not how many times it exists.

    Then we use the contains() command to look for Option1. Since Ninox returns an array, we can quickly check it against a value we pick.

    Then we fill in the then part. You can put whatever you want here.

      • jason.1
      • 5 days ago
      • Reported - view

       PERFECT!!!  Thank you so much!!

      • Fred
      • 5 days ago
      • Reported - view

       Glad it worked out. Please mark the post "answered" when you have a moment.

Content aside

  • Status Answered
  • 5 days agoLast active
  • 3Replies
  • 37Views
  • 2 Following