Edge actions - how to write to gpio1 on pin 24 iot card?

hi
i’m trying to create edge action to on a load.
I am trying to read a push-button INPUT on pin26 at iot card, the and cannot write to Port GPIO1_PIN24.
The value is true or false.
What am I missing here?

function(event){

var result = Datahub.read(’/io/IOT0_GPIO3_pin26/value’, null);
var _t_slot_0_on_pin_20 = result ? result.value: null;
var val = true;

if (_t_slot_0_on_pin_20){
val = false;}

return
{
‘dh://io/IOT0_GPIO1_PIN24/value’ [val]
}
}

thanks
elkana

function(event) {

	var result = Datahub.read("/io/IOT0_GPIO3_pin26/value", 0);
	var _t_slot_0_on_pin_20 = result ? result.value: null;
	var val = !!_t_slot_0_on_pin_20;

	return {"dh://io/IOT0_GPIO1_PIN24/value":[val]} 
}

A ‘:’ is missing before [val]

Hi Elkanam,
Is it working now? If not, could you please tell me what device you are using? (mangOH Red, mangOH Yellow, FX30, or your own?)
Thanks
.Thibault.

Thanks
It’s working.
I’m on MangoH yellow.