Page 1 of 1

Dropdown values

Posted: Tue May 07, 2019 2:47 am
by HeshanKaru1994
Hi, How to generate dropdown values(array variable ) from using pm tables. (Working sample would be nice)

Thank you

Re: Dropdown values

Posted: Tue May 07, 2019 7:45 pm
by amosbatto
Can't you figure it out from the example in the documentation?
Code: Select all
@=varDataSource = array();
$result = executeQuery("SELECT MY_VALUE_FIELD, MY_LABEL_FIELD FROM PMT_MY_TABLE");

if (is_array($result)) {
    foreach ($result as $row) {
        @=varDataSource[] = array($row['MY_VALUE_FIELD'], $row['MY_LABEL_FIELD']);
    }
}

Re: Dropdown values

Posted: Tue May 07, 2019 7:51 pm
by amosbatto
Also, please post these types of questions in the "Developing processes & programming" forum.

This forum is "Community Contributions > Code" and it is for contributing code to the ProcessMaker source code.

Re: Dropdown values

Posted: Tue May 07, 2019 9:06 pm
by HeshanKaru1994
Sorry next time I will post there