- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 09:59 AM
I have cretaed Sys_property : Authorization group where i have added values.
{"group value":"group sys_id",
"group value"1:"group sys_id1",
"group value2":"group sys_id2"
}
In the workflow if i selected one group workflow needs to send an approval to remaining groups (not current group which i selected).
I written below code but it is sending to all 3 groups.
var GroupProperty=jsonProperty.parse(gs.getProperty('Authorization group'));
for(var i in GroupProperty) {
if( i!== currentChgCreationGrp) {
answer.push(GroupProperty[i]);
}
}
Could any one please help this much appreciated!
Thank you,
Gayam
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:23 AM
Hello @Kanna12 ,
I'd recommend you to use a separeted-comma value in the sys_property instead using JSON structure, I let you a useful code for pop out value from array when it's found:
var groups = '019ad92ec7230010393d265c95c260dd,477a05d153013010b846ddeeff7b1225,553032e853165110b846ddeeff7b12aa';
var arrGroups = groups.split(',');
var index = arrGroups.indexOf('477a05d153013010b846ddeeff7b1225');
if (index > -1) { // only splice array when item is found
arrGroups.splice(index, 1); // 2nd parameter means remove one item only
}
gs.info(arrGroups);
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:38 AM
my original Properties are
{"it_dev":"f5ecc7a31b7dbd10bf2210ad9c4bcb16",
"it_test":"026d87a31b7dbd10bf2210ad9c4bcb85",
"it_preprod":"187d0fa31b7dbd10bf2210ad9c4bcb1e",
"it_prod":"388d0fa31b7dbd10bf2210ad9c4bcb20"
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:41 AM
@Kanna12 have you tried with script which I have provided ? It will work. i have tested with your new json values as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 07:20 PM
It worked out!
Thank you!
Much appreciated