Max, one tricky problem.
I have a data field with 0 to 8 comma separated values which i want to use to popolate a dropdown field. The data field changes dynamically therefore, i have not found an easy solution. Any hint?
the field is on the same form page ? or is it a database table field ?
so you need the dropdown to have these options when the form page is loaded ? or how should this work ?
Yes, I need to have these options when the page is loaded. The options in the database field (varchar(63)) may look like that: ["R","G","T"] or have more options.
The easiest way is to get the variable from Read Data and prepare it in a PHP action in the format supported by the Dynamic Options behavior, the dynamic options behavior requires an associative array, so your PHP code can be like this:
$return = [];
foreach($this->get("read_data.column") as $k => $v){
$return[] = ["id" => $v, "text" => $v];
}
return $return;
And your Dynamic Options will be like this:
just change the "php_name" to the real name of your PHP action