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

Moderators: ArturoRobles, ArturoRobles

Hello everybody,

I have to calculate a specific variable for a user logged according to his groups of membership.

I try to do it with this code but $query1 part seams to doesn't work (if I replace $result1 by a list of group id in $query2, it works as I want).

[email protected]@USER_LOGGED;//user_uid of user logged
$query1= "select distinct GRP_UID from GROUP_USER where USR_UID=$UserID";//groups of user logged
$result1= executeQuery($query1);
$query2= "select distinct GRP_TITLE, GRP_UID from GROUPWF where GRP_TITLE like '$reglenommage%' and GRP_UID in($result1)";//groups matching to namerule within groups of user logged
$GroupTitle=$result2[1]['GRP_TITLE'];//first result matching
$region = substr($GroupTitle, 11, 6);//truncate group name

Could you help me, please ?
Your code should be well-written to make it easier for you to understand and troubleshoot.
Please check this code:
Code: Select all
$reglenommage = "RVD_NAT_DA_H66";	//namerule
$UserID = @@USER_LOGGED;			//user_uid of user logged

$query = '
	select distinct GRP_UID
	where USR_UID = "'.$UserID.'";
$result = executeQuery($query);

$temp = [];
foreach($result as $row)
	array_push($temp, $row['GRP_UID']);

if(count($temp) > 0){
	$query = '
		select distinct GRP_TITLE, GRP_UID
		from GROUPWF
		where GRP_TITLE like "'.$reglenommage.'%" and GRP_UID in("'.implode('" , "', $temp).'");
	$result = executeQuery($query);
	if(is_array($result) && count($result) > 0){
		$GroupTitle = $result[1]['GRP_TITLE'];	//first result matching
		$region = substr($GroupTitle, 11, 6);	//truncate group name
		@@INIT_CODE_REGION = $region;
} ... 1iw/videos
disable value in dropdown

Check box is more helpful rather than drop down op[…]

Timeout Not Sending Email

I would like to thank you for the efforts you have[…]

use 'insert into' in a trigger

Is your syntax correct? Shouldn't you be using s[…]

issue with processmaker 3.2

You mean the code in the trigger below? That is t[…]