- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2024 12:47 PM
Hi Please see all my screenshots below.
to summarise what im trying to do is create a workflow that will automatically assign an SCTask created on the back of a RITM to an assignment group based on the location field selected by the requestor. So for example If location is England, France or Germany then assignment group will be Europe, if the location is Mexico, Canada, Brazil it will be assignment Group Americas
the flow for some reason below does not work can you help me identify the issues please
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 08:27 AM
@Adil N If you do have a large number of locations, that is even more of a reason to use Decision Tables. The UI for creating a decision table is very easy to pick up, and it is quicker to add your logic to the table than it is to build out a long or complex set of if statements.
Regardless of whether you if statements or Decision Table, be sure to get a good understanding of the data structure and hierarchy in the Location table (assuming that your variable is a choice reference that pulls locations from that table). There are logical geographic groupings here that you can leverage, and instead of calling out the individual locations, it would be easier to dot-walk to a common field (such as region).
Even in times of rushed development, you should always set a strong foundation for future extensibility. You never know how long your solution will be in place, nor the next time that you will have a chance to update it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 02:18 PM
Well in this screenshot, you can see that If Asia is looking at a location field that's returning blank, and your IF Americas is just looking at the SCTASK, nothing inside of it, which results in the SYS_ID of the SCTASK.
And then, your screenshot shows you're looking for a Catalog Variable, but your flow never gets the variables. Use the following action as your second step in your flow, and point it at your SCTASKs Requested Item:
then select your catalog item or variable set, and move over the field you're looking to use:
Then update your IF conditions to use that value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 08:36 PM
Hi @Adil N,
I see where there are issues in your Flow.
If you look at the Flow execution, your first if statement is trying to compare a sys_id string to the value you entered ("Washington"):
So, the Flow executed properly. However, it evaluated false, because you are not comparing like items.
Looking at if statement, the data pill doesn't quite show what you are pulling in:
Looking at auto-description in the other image you provided, it appears that you pulled in the catalog task record itself? That could explain the sys_id string, because it means you have not connected to a specific field, but the record itself (which gets represented by a sys_id).
Looking at you other if statement, you appear to be pulling in the location field from the catalog task:
However, there is nothing in the location field on the catalog task. You can see this in the execution details, because there is nothing in front of "LIKEBali":
There's a number of things you need to do here.
1. Your first step in the Flow should be the Get Catalog Variables action, so you can pull in the variables from the form.
2. Your if statements need to be updated to use the variables that are pulled in via step 1. Also, if the location is a reference, be sure to dot-walk to a field within the reference (or else you'll get a sys_id string again).
3. You'll need to determine what data point(s) are most applicable for your conditions.
These are the things that must be done at a minimum. However, I have some recommendations to generally improve the process as a whole:
1. For your trigger condition, instead of using the short description, I'd recommend dot-walking to the parent item (the RITM record) and set the condition so that the RITM's Item field is the catalog item you have created. This will isolate the flow to only run on tasks created via the form and is a more reliable evaluation than comparing hard coded strings.
2. I'd look into using Decision Tables. In a decision table, you provide the input value (which would be a location), and then the table returns specified value(s) based on that input (the assignment group in this case). In the Flow, this would allow you to only need to have one Update Record action, as you would be able to put in the decision value into the assignment group field.
3. I recommend brushing up on some of the content in Now Learning, there's a lot of great content there to help understand REQ/RITM/SCTASKs, Flow Designer, and much, much more. It is a great resource that I turn to often.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 03:00 AM
@Prinssi Thank you very much. I will take a look I think for the amount of locations i will need to input a Decision Table is probably the best option however I have not developed on of these before so I am looking to get something in ASAP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 08:27 AM
@Adil N If you do have a large number of locations, that is even more of a reason to use Decision Tables. The UI for creating a decision table is very easy to pick up, and it is quicker to add your logic to the table than it is to build out a long or complex set of if statements.
Regardless of whether you if statements or Decision Table, be sure to get a good understanding of the data structure and hierarchy in the Location table (assuming that your variable is a choice reference that pulls locations from that table). There are logical geographic groupings here that you can leverage, and instead of calling out the individual locations, it would be easier to dot-walk to a common field (such as region).
Even in times of rushed development, you should always set a strong foundation for future extensibility. You never know how long your solution will be in place, nor the next time that you will have a chance to update it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 08:59 AM
Hi @Adil N ,
You can simply create an Assignment rule.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------