flow designer script the assignment group based on a catalog variable chosen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2021 11:01 AM
for 'Create Catalog Task' action in my flow, I have scripted the Assignment Group as one that has a name that starts with 'CLD - Saas' and contains the name of the product variable:
var ag = fd_data.trigger.current.assignment_group;
var product = fd_data.trigger.current.variables.product;
var group = new GlideRecord('sys_user_group');
group.addEncodedQuery('nameSTARTSWITHCLD - SaaS^nameLIKE' + product);
group.query();
if (group.next()) {
ag = group;
}
return ag;
but when I try to activate the flow it gives me an error about not being able to use 'current'.
What am I doing wrong?
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2021 12:52 PM
Hi,
I would recommend looking into Decision builder instead of scripting a value what group should be selected, then you can use the Flow action "Make a decision".
Look at this video if you're interrested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2021 02:01 PM
I'd love to try this but PDIs don't allow Store installs so I can't use the decision builder they used. I tried building a decision table manually without Decision Builder but I'm so lost and can't figure out how to get the variables from my specific catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2021 03:20 PM
The list of products on the catalog form is a choice list and has a bunch of options, two of which are
-banner
-analytics
I created a decision table that has these things:
- answer table: sys_user_group
- inputs:
- reference to the variable table | name: u_item
- reference to sc_req_item | name: u_req_item
- decisions:
- condition: u_item.variable_name=banner | answer: banner group
- condition: u_item.variable_name=analytics | answer: analytics group
Then added the decision to the flow:
and a catalog task to use the Group Record from the result of the decision
however, the group doesn't get assigned and in the description the sys_id of the group is blank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2021 01:00 AM
So it seems like something is wrong with the decision you've created.
I don't have much or good experience with the original decision table/UI, I think it's a bit confusing, so i really can't help you much more there.
