Foundry Slate: Try to update variable based on a SQL request triggered by an event

Viewed 43

I try updating a variable on dropdown changing. When the user change the value, an SQL request is executed, then the result must update a variable. It doesn't work it's must be a synchronization issue. But I don't know how to figure it out. Here's my code

Event code to update {{v_date}} variable

console.log("1")
const maxDate={{f_maxDate}}
console.log("4")
return maxDate

Function code: f_maxDate

const date = {{v_date}}
console.log("2")
const max = {{q_maxDate}}//call of my sql request
console.log("3")
date.value = max.maxDate[0];
return date

In my console, I should have 1 2 3 4, but I have 1 4 2 3. The variable "maxDate" is always empty. Thanks for helping

0 Answers
Related