Forum Discussion

SystemAdmin4's avatar
SystemAdmin4
Qrew Member
4 years ago

Programmatically deselect invalid multiselect options

Hi,

I have a multiselect field in my primary which draws its potential selections from another secondary table.

The valid selections change over time - new ones are added, old ones are deleted and existings ones may be changed.

 At the moment, this is a two step process.

Step 1 - amend the valid selections in the secondary table then
Step 2 - gridedit all records in the primary table where there are now invalid selections (usefully highlighted in red by QB).

There will always be some manual work involved with this process, but at the very least it would be very useful to be able to use an API call to automatically deselect any and all selections which are no longer valid (the ones QB highlights in red) and update the relevant records in my primary table

Is this possible, and if so how, please?

Thanks

David



------------------------------
dmlaycock2000 dmlaycock2000
------------------------------

3 Replies

  • It sounds like you're deleting / editing the values in your selections table, and your drop-down is an actual Text-Multiple Choice that you've set to use the selections from another field, which I would actually recommend against. If that is the case, this is how I would suggest setting it up:
    • Make sure that you're Selections are on a table of their own
    • On this Selections table, add a checkbox field - "Active"
    • Mark all 'Active' selections appropriately and then create a report that is filtered on the "Active" field
    • Create a relationship from your Selections table to the primary table where Selections is the Parent table, being sure to select Selection and Active as lookups when building this relationship
    • Replace your current drop-down with the new Selection lookup
    • Set the new Selection drop-down to use the Active Selections report you built earlier

    This will make it so that only Active selections can be chosen once something is changed, but you will still need to update anything that has a Selection that is not Active. You can do this by creating a report in your primary table that is filtered by the "Active" field from the Selections table. You could also build an Automation or a Pipeline to run every night to pull these records and update the selection to blank.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • SystemAdmin4's avatar
      SystemAdmin4
      Qrew Member
      Thanks Blake

      I went with the multi-select with values drawn from a separate table for a whole host of reasons.

      It is without doubt the most elegant and easy to understand solution for a user when adding and editing records in the primary table - for them to simply select options from the drop down, in what is essentially a many to many relationship.

      But I agree my quest to make it easy for the user, has created no end of other problems!

      Anyway, many thanks for your input on this - however my current feeling is that my best option is to sacrifice the UI usability benefits of the multi select field, and revert to a relationship based model. 

      D

      ------------------------------
      dmlaycock2000 dmlaycock2000
      ------------------------------
      • BlakeHarrison's avatar
        BlakeHarrison
        Qrew Captain
        Maybe there was a bit of confusion on both sides, but the relationship model was what I was suggesting. The original setup of a Multi-select text with choices based on another field is admittedly easier for the user, but is not scalable.

        ------------------------------
        Blake Harrison
        bharrison@datablender.io
        DataBlender - Quick Base Solution Provider
        Atlanta GA
        404.800.1702 / http://datablender.io/
        ------------------------------