Picker with multiple values


#1

Hi,

I have a picker with datasheet source containing label and two values (value1 and value2).

When picker is selected, I want to save value1 to ds_slot1 and value2 to ds_slot2. There is no way to select two values in the GUI. Wondering if a script could do the trick?

Thank you
Mac


#2

Hi, Yes the picker interaction can save only the Value field into Data slot. You could probably create a script which saves the “selected label” from Picker but it requires that you can access Picker from the script. If you look at the exported code you can see that saving the value is pretty simple. You could just add saving to other Data slot there but you need to make sure that you edit/merge the code every time you export projects from Studio (old code will be overwritten by default).

pickerValueChanged_picker = (event) => {
this.setState({picker: event.target.value});
this.props.appActions.updateDataSlot(“ds_SlotExample”, event.target.value);
}