I want to create child record based on parent record states
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Hello @ServicenowMasters,
Can anyone help me out. Actually, Users can able to create a child record manually based on specific states of parent record. Can anyone help me how can we do it. Here child record is nothing but right side panel on workspace of feedback task and parent record is nothing but control objective. This help will be a great to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
@MuppuriNagaraju Here is the step-by-step approach to achieving this without custom coding, ensuring the child record links properly.
Navigate to Process Automation > Flow Designer.
Click New > Flow. Name it (e.g., "Create Feedback Task on State Change").
Trigger: Select Record Updated.
Table: Control Objective (sn_compliance_control_objective or relevant table).
Condition: [State] [Changes to] [Target State] (e.g., "Closed", "Review").
Run Trigger: Select For every update.
Actions:
Click Add an Action > ServiceNow Core > Create Record.
Table: Select the Feedback Task table (e.g., sn_grc_feedback_task or kb_feedback_task).
Fields:
Parent/Reference Field: Map this to the triggering Control Objective record (drag the Control Objective record data pill into the field that references the parent).
Populate other mandatory fields (e.g., Short Description).
Save and Activate the Flow.
Navigate to Workspace Experience > Actions & Components > Actions.
Create a new Action.
Action Type: Button.
Action Assignment:
Label: Create Feedback Task.
Table: Control Objective.
Implemented as: Flow (Select the flow created in Step 1) or Scripted (if needed for complex logic).
Workspace Conditions: Ensure the button only appears when the parent is in the correct state (e.g., State is x)
OR
If you want the child task to appear immediately without user interaction upon state change, you can use a Business Rule:
Table: Control Objective.
When: after update.
Condition: State changes to [Target State].
Script:
var gr = new GlideRecord('sn_grc_feedback_task'); // Target Table
gr.initialize();
gr.parent = current.sys_id; // Set relationship
gr.short_description = 'Feedback for ' + current.number;
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @Nilesh Pol, Thanks for replying. This answer is also I think would work. In here already the right side panel of feedback task is already present. I wanted to restrict the users for creating feedback task based on control objective states and also i wanted to know Is the business rules or flow designer could work for achieving the solution and also we have new button already present in the feedback task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@MuppuriNagaraju then you find the New button UI Action that targets your Feedback Task table (sn_compliance_control_objective or custom table depending on your architecture). In the Condition field, append a check for the parent record's state.
add condition: Only show if parent Control Objective state is NOT 'retired' (10) or 'draft' (1)
current.canCreate() && parent.state != '10' && parent.state != '1'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
55m ago
@Nilesh Pol , But this new button is out of the box button. I think by updating the OOTB button is not a best practice. Can you please suggest me any other solution.
