- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 11-14-2019 02:36 PM
One of the most talked about feature of ServiceNow is it’s no code/low code application development capability. Non-technical team members like business analyst can perform administration tasks within the tool without the need for scripting. Flow Designer is one of these applications within the tool that comes with no code/low code functionality. In this blog post, we will review how the flow designer could be used for creating a business rule (server side script) without coding.
Use case: Creation of a problem record when a priority 1 (P1) incident is resolved.
Steps:
1. Go to Flow Designer in navigation pane and click on “Designer”. This should open the flow designer in a new tab.
2. Next click on New -> Flow.
3. Fill in the form for new flow as shown below and click submit.
4. This will load the new flow screen like below,
5. A trigger is the condition that triggers the flow. For this use case, the trigger is a P1 incident state change to resolve.
6. Click the “+” under TRIGGER and select the second Record updated trigger.
7. Select Table as Incident and add filter for priority=1 and state changes to Resolved. Set Run Trigger as “For each unique change”. Click “Done” to save the trigger.
8. Next create an action that the flow needs to take when triggered. Click the “+” under actions -> Click on Action -> Under ServiceNow Core select “Create Record”
9. Select the Table Name as Problem. Next click “Add Field Value” and choose description from the list of fields available for a problem record. Click on Data Pill Picker and select Trigger – Record Updated -> Incident Record -> Description field as shown in the screenshot below. This is dot walking in ServiceNow.
10. Similarly Add fields Business Service and Configuration item and choose appropriate incident record field by dot walking from Data Pill Picker and click done. Your action should look like below,
11. Now Save the flow and click on Test.
12. Choose a P1 incident record to test the flow. Click “Run Test”.
13. Once the flow has been executed, select “Click here” and look at the execution record. If both trigger and action records show completed then your test was successful.
14. The execution detail shows information on incident updated trigger and create record action. Click the “Create Record” action and you can see the problem record number that was created by the flow.
15. Click open record to view the problem record. Go to Incident related list and notice that it’s empty.
Question – Do you know why related list “Incidents” is empty?
Answer – Because we haven’t added an “update record” action on the incident table to link it to the problem record created by our first action.
16. So, let’s go back to our flow and add a second “Update record” action to link the incident and problem record.
17. Click “+” after create record action and select “Update record” action from ServiceNow Core actions.
18. Select the Incident record from Data Pill Picker. Table field is auto-updated.
19. Click “Add field” and Select field “Problem” from the list. Select the problem record created by “Create Record” action using the data pill picker. See screenshot below,
20. Save the workflow and test again with another P1 incident. The problem and incident records should be linked now.
Lastly, activate the flow to publish the functionality in the instance.
Hope this helps! Feel free to reach out if you have any questions.
- 4,263 Views