Update a dropdown with multiple selections in Record Rules

In Record Rules I would like to update a dropdown field that allows multiple selections with another option, instead of the "set" option that is available which replaces the current entry with the new option. Is there any way to add to the selections instead of deleting what is there and replacing it with a new value?

Thank you Sergi - I will try! I'm not very good at javascript but realize it would be of benefit to learn.

You are certainly right Pamela, Knack has not solved the record rules for multi-selection fields well. They would have to consider the possibility of adding a new selection to the field.

If it helps you I leave the javascript code that allows you to add a new selection to a multiselection dropdown after update a record.

Firstly search in your builder your edit form key, and the number of your multiselection field:

In the following code
- view_XXX is the key of your edit record form.
- field_XXX is your multiselection dropdown field number.
- object_XXX is your object database númber.
-"New Choice" is the new option that we want to add to our multiselection field

Add this code in your API&code Javascript section: ( Remember to replace the XXX with your numbers and replace api-key and app ID)

$(document).on('knack-record-update.view_XXX', function(event, view, record) {
var my_array = record.field_XXX_raw;
var n = my_array.includes("New Choice");
if (!n) {
my_array.push("New Choice");

var url = 'https://api.knack.com/v1/objects/object_XXX/records/'+record.id;
var headers = {
'content-type': 'application/json'
}; //close headers

var dataIntro = {
field_XXX: my_array

url: url,
type: 'PUT',
headers: headers,
data: JSON.stringify(dataIntro),
}).done(function(responseData) {
console.log('Record updated!');



I understand that, I am trying to update a field in record rules that is a dropdown field that allows multiple selections. There is already a selection in there and without deleting the selection that is in there I want to add another selection. I.E. an record has the option of being a customer, a supplier and an employee. The person is already a supplier but I want to update them to be a supplier and a customer. The "set" command replaces the supplier option with the customer option.

Well, you can add new options to a dropdown.

If edit the dropdown field in your form and check the option "allow user to add a new options"

If you want to do it without user interaction, and add some value to your dropdown after to submit, it can be do it with javascript.