- 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 12:32 PM
According to Google, "Liczba" is Polish for numbers of a thing. AKA, count.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-30-2024 12:44 AM
Hi @Robert ,
My apologies for replying late but your solution worked! Loved the video as well.
Regards,
Saurabh
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-23-2024 06:29 AM
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-24-2024 01:50 PM
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
Wednesday
@Uncle Rob 
I've reviewed this article and watched the video and, for some reason, the Look Up Records does not appear to be working for me.  When I set the Name of the person in the Flow, it works, but when I try to pull the Requested For > Name (or any other dynamic value), the RUNTIME VALUE returns null (in the image I'm playing around with the sys_id, but it does appear to work with any dynamic value).  Any thoughts?
Thanks!
