Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By ariannovin
#824091
Hi
i want to have some general attributes or variables or configurations that in the user's processes i can use them to display data base on them.
for example i have a variable which indicates financial year, by changing the value of this variable by user some dropdowns in processes assigned to this user should be changed respectively.
thousand thanks in advance. :)
User avatar
By amosbatto
#824104
Create a PM Table (or a Table in your external database) which is named USER_OPTIONS and has the following fields:
ID (int, autoincrement, primary key)
USERNAME (varchar)
FIELD1 (varchar)
FIELD2 (varchar)

Add records to the the table that contain th options that you want for each user in FIELD1 and FIELD2.

Then create a Dynaform which has the following fields:
* Textbox with the ID and variable "currentUsername"
* Dropdown with ID "selectField1" which has the following SQL query:
SELECT FIELD1, FIELD1 FROM PMT_USER_OPTIONS WHERE [email protected]@currentUser
* Dropdown with ID "selectField2" which has the following SQL query:
SELECT FIELD2, FIELD2 FROM PMT_USER_OPTIONS WHERE [email protected]@currentUser

Then create the following trigger:
@@currentUsername = @@USR_USERNAME;

Set this trigger to fire before the above Dynaform.

See:
https://wiki.processmaker.com/3.1/Dependent_Fields
https://wiki.processmaker.com/3.2/DynaF ... SQL_Format
User avatar
By ariannovin
#824114
Many thanks for your comprehensive response.
unfortunately using pm table is not an option for me as i want to access it via normal users (they may have not access to that pm tables).
i want to have these configuration some where else which each user can access it and be able to modifies its values.
Suggest box not filtering

Thank you so much for your reply. I had the same t[…]

thanks for info

Dear Amosbatto, I managed to connect rest api via[…]

This is a very nice blog to watch out for and we p[…]