Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove selections on a multiselect field with Adatavist Behaviors

jgiraldo1 January 16, 2020

Say I have a multi-select field for which I am using Adaptavist Scriptwriter behaviors to select the value of the said multi-select field (based on the value of other fields).

Since it is a multi-select field, every time I call .setFormValue() it appears to appends to a list of selected values.

eg: 

multiselectfield.setFormValue("Value 1")
multiselectfield.setFormValue("Value 2")
multiselectfield.setFormValue("Value 3")

if then overlay the value of multiselectfield you get ["Value 1", "Value 2", "Value 3"]

is there a way to specify in .setFormValue that you dont want to append to the values list, but instead you want to replace the previous value?

I've tried 
multiselectfield.setFormValue("Value 1")
multiselectfield.setFormValue(null)
multiselectfield.setFormValue("Value 2")
multiselectfield.setFormValue(null)
multiselectfield.setFormValue("Value 3")

but assigning null doesnt seem to really clear the previously selected valued for the field.

Or may be a way to specifically assign a value to the first position of the value list?

say something like multiselectfield.setFormValue[0]("Value 2")

0 answers

Suggest an answer

Log in or Sign up to answer