Looking for a Script that adds an option to a “multiple select” when a new record is created in a near by Table.
It’s a base that works as an app for Sending Whatsapp messages.
there is a “multiple select” field that needs to be connected to another table with costumer names and phone numbers. so that when a new record is created the costumer name would pop as an option in the multiple select field.
Any ideas ?
You could do this with scripting, but I would personally recommend using Link Records fields as that’s exactly what this field type is for.
If your WhatsApp integration requires you to use a MultiSelect field and isn’t compatible with a Link Records field, you can have an Automation copy the Link Records field into the MultiSelect field. Or as I said use a script to add select options to the field when new customers are added.
I would argue that using a multiple-select field like this would definitely not make it long-term-maintenance-friendly. I’m all for making things user-friendly, but if it negatively impacts the developer experience—like I feel it would in this case—I would seriously question if it’s really worth it. In this case I’d see the use of color as more of a “it might be mildly helpful/interesting”-type feature and not necessarily something that will clearly improve the user experience.
If color is important, you can introduce color by adding colorful emoji to the primary field value. It isn’t the same as multiple-select coloring, but many people find it to be a good balance between wanting both color and the power of a linked record.
You can even have the automation add the emoji to the primary field value, although you will need a a technique to pick a different emoji for each record, such as a script or a formula.
Also note that automation scripts cannot create new multiple-select choices, although the “update record” action can.