- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 04:40 AM
Hi All,
I have a requirement where , for example , if a RITM is raised using a specific Catalog Item, then in the Flow Designer, it will be required to check if the 'Requestor' belongs to the 'Knowledge Function Group'. If 'yes' then the SCTASK would automatically get created without any approval.
The end user populates the 'Knowledge Base' field in the Catalog Item and Submits the Request.
Tables:::
=======
Requestor ::: sc_req_item ( Get the Requestor Name )
Group-User Relationship ::: sys_user_grmember ( Get the Users against each Group )
Group Mapping ::: x_custom_table ( Mapping between Knowledge Base and Knowledge Function Group ) . The 'x_custom_table' is the table which holds the mapping between Knowledge Base and Knowledge Function Group ( which is basically the sys_user_group )
Query ::: What should be the correct approach to achieve this, using lookup record, as this involves all the three tables as stated above? Would it be possible to achieve this using conditions if not then what should be the script? I was trying to use the below script but then will this work?
var groupName = fd_data.trigger.current.knowledge_functional_team.name;
//var reqT = fd_data.trigger.current.request.request_for.name;
var arr = [];
var grUserGr = new GlideRecord('sys_user_grmember');
grUserGr.addQuery('group.name', groupName);
grUserGr.query();
while (grUserGr.next()) {
arr.push(grUserGr.getValue('user'));
}
for(i=0; i<=arr.length; i++){
if(reqT == arr[i]){
return true;
}
}
Thanks and Regards,
Saurabh Chatterjee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 06:27 AM
Easy peasy in flow designer.
1) Look Up Records (plural!) on the sys_user_grmember table (where group memberships are stored)
- CONDITIONS
--- Group = Knowledge Function Group AND
--- User = <drag requestor from Trigger Record>
2) IF <drag COUNT from node 1> is GreaterThanOrIs 1
2.1) Do the thing you want
ELSE
2.2) Do the thing you don't want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 06:27 AM
Easy peasy in flow designer.
1) Look Up Records (plural!) on the sys_user_grmember table (where group memberships are stored)
- CONDITIONS
--- Group = Knowledge Function Group AND
--- User = <drag requestor from Trigger Record>
2) IF <drag COUNT from node 1> is GreaterThanOrIs 1
2.1) Do the thing you want
ELSE
2.2) Do the thing you don't want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 07:29 AM
Hi @Robert ,
Thank you for your response. Can you please let me know how to select 'Count' in the 'If' Condition?
Regards,
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 07:31 AM
Don't use Look Up Record. Use Look Up RecordS
Look Up Records will have a node property called Count. Then you just drag that into the first part of your condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 07:46 AM