Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

Dear Amosbatto,

this is what I get when I change the codes:
Code: Select all
array(11) {
  array(9) {
    string(28) "XXXX, XXXX"
    string(37) "XXXXXX"
    string(26) "[email protected]"
    string(28) "XXXX, XXX, XXXX" (-> this is where I want to list in the dropdown first.)
    string(15) "XXXX"
    string(7) "XXXXX" (-> this is what I want to list second.)
    string(7) "XXXX" (-> this is what I want to list third.)
    string(78) "ou=XXXX,ou=XXXXX,ou=XXXX,ou=XXXX,o=XXXXXX,c=XX"
    string(67) "UniMrHash=XXXX,ou=XXXX,ou=XXXX,o=XXXX,c=XXX"
I have just anonymized the data .
I don't see any error in your code.

As always, you need to break this down to by adding more var_dump() and die(), until you find the problem.
If you do this, do you see the complete names in the array?
Code: Select all
        foreach ( $aUsers as $user ) {
            @=selectDpt[] = array($user['department_dn'], $user['department_display_name']);
            @=userList[] = array($run . '', $user['given_name'] .' '. $user['surname']);
Dear Amosbatto,

I have revised the codes as you mentioned, but it comes with the following error unfortunately.

Selection_756.png (45.08 KiB) Viewed 995 times
Selection_757.png (26.67 KiB) Viewed 995 times
Hi again,

when I comment out vardumps and die, then it works but it does not list the department names as well as the users.

Selection_758.png (39.5 KiB) Viewed 994 times
Selection_759.png (10.5 KiB) Viewed 994 times
The point is to see what is in your first set of arrays, but I was just cutting and pasting and not paying attention. You check each thing until you figure out what is the problem.

Do this:
Code: Select all
        foreach ( $aUsers as $user ) {
            @=selectDpt[] = array($user['department_dn'], $user['department_display_name']);
            @=userList[] = array($run . '', $user['given_name'] .' '. $user['surname']);
Dear Amosbatto,

This is what I get with that code: array(1) { [0]=> array(2) { [0]=> string(78) "ou=XXX,ou=HRZ,ou=XXXX,ou=XXXX,o=XXXX,c=XX" [1]=> string(28) "XXXXX" } } array(1) { [0]=> array(2) { [0]=> string(0) "" [1]=> string(15) "XXXXXX" } }

Note: The "X"s were written by me.
Hi again,

the following codes allow me to reach the correct path of the data and list the departments and users but they only take the second letter of the string given in the system. I can not list the full departmental name, first name and surname of the users. For example, "n" from "string(28) "University: .." and "o" from string(7) "Johan".
Code: Select all
$username = 'XXXX';
$password = 'XXXX';
$url = "XXXXXXX";

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);

curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);


if ($result === false) {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    @@error = "Error: HTTP status code: $statusCode\n";
} else {
    $aUsers = json_decode($result, true);
    if (empty($aUsers)) {
        @@error = "No users returned";
    else {
        @=selectDpt = [];
        @=userList = [];
        foreach ( $aUsers as $user ) {
            @=selectDpt[] = array($user['department_display_name']);
            @=userList[] = array($user['given_name'] .' '. $user['surname']);

Selection_761.png (9.82 KiB) Viewed 968 times
When you run the case in Debug Mode, what are the values of the selectDpt and userList variables in the debugger?

Also, make sure that you are only using the @@selectDpt and @@userList variables in the data variable property of the dropdowns. If you use the same variable for both the dropdown's variable and its data variable, then you will have problems.
Dear Amosbatto,

I have recently changed the variable and data variable but the result is the same and this time I do not event get access to the data listed in rest api side.

See set ups:
Selection_768.png (26.07 KiB) Viewed 75 times
I have another trigger in the same dynaform to call the user details and it is from the same rest api with similar codes. Does this make any matter?
Dear Amosbatto,
yesterday I solved the problem after revising variable with different names. The dropdowns are now populated by the correct data coming from the rest side. Thank you for your recommendations. Now I want to assign my second used from the second dropdown that I got name and surname from the rest. I want to use "value based assignment" for that purpose but I could not manage that. Can you recommend me some instructions or samples that I can have a look?
Erdal Ayan
erdalayan wrote:Now I want to assign my second used from the second dropdown that I got name and surname from the rest. I want to use "value based assignment" for that purpose but I could not manage that. Can you recommend me some instructions or samples that I can have a look?
The UID of the user needs to be in the variable used by a task with Value Based Assignment.

The variable used by the "Colleague" dropdown box needs to be set to the UID of the user to assign to the task if that same variable is used for Value Based Assignment.
Also remember that all the users who might be set in the variable also need to be in the assignment list for the task.

If you need examples, there are 5 examples here that use Value Based Assignment: ... g_of_tasks
The variable that you are using for Value Based Assignment isn't set to the ID of the user to assign to the task.

You need to study this example: ... _same_task

It shows you how to populate the dropdown box with the users in the assignment list a task and select one to assign to the task.

PS: Next time that you have a question, start a new thread with a new title that reflects the question.
Task doesnt have any users.

I have created a small process. Users are assigned[…]


Just trying to setup to use the mobile App with my[…]

It's really a great idea. I have followed the seco[…]

yes i use php thanks for the information