Skip to main content
Question

Programmatically deselect invalid multiselect options

  • Oct 21, 2020 2:49 PM UTC
  • 0 replies
  • 72 views

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
------------------------------
This topic has been closed for 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/
------------------------------