Page 1 of 1

Populate from a dropdown

Posted: Wed May 01, 2019 3:34 pm
by ebryant
I'm having issues when trying to populate a field based on the selection within a dropdown. I'm using the following SQL:

SELECT N.DEPTID, O.SUPNAME
FROM PMT_DEPT_SUPER O
JOIN PMT_DEPARTMENTS N
ON O.DEPTID = N.DEPT_ID
WHERE N.DEPARTMENT = @@DeptID

Can a dropdown be used for this purpose? Or is there a way to suggest a value when a user is typing in a field?

Thanks

Re: Populate from a dropdown

Posted: Thu May 02, 2019 11:53 am
by rogerdeku
Hi ebryant geek

I would recommend you

1 Review your SQL Syntaxis
2 Check "Populate a Dropdown with a Database Query"
https://wiki.processmaker.com/index.php ... 24_DBArray and
https://wiki.processmaker.com/3.0/Dropdown_Control

Depending your Process Workflow such dynaform design you have. uggek
A dropdown will be use in this case, other way. I would suggest you.

A dropdown alternative could be an autocomplete field. 8)
https://wiki.processmaker.com/3.2/Suggest_Control

Re: Populate from a dropdown

Posted: Thu May 02, 2019 7:51 pm
by amosbatto
ebryant wrote: Wed May 01, 2019 3:34 pmI'm having issues when trying to populate a field based on the selection within a dropdown. I'm using the following SQL:

SELECT N.DEPTID, O.SUPNAME
FROM PMT_DEPT_SUPER O
JOIN PMT_DEPARTMENTS N
ON O.DEPTID = N.DEPT_ID
WHERE N.DEPARTMENT = @@DeptID

Can a dropdown be used for this purpose? Or is there a way to suggest a value when a user is typing in a field?
You can use a text field as a dependent field and a dropdown as an independent field, so your query should work as long as you spelled everything correctly, but you probably want to use a suggest box instead of a text field (as rogerdeku recommends).