Entity as a input to Subflow in post automation - Australia release
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello all,
We are on Australia release and I wanted to create control record from Smart Assessment Engine post automation once the assessment is submitted by Assessor. I have created a flow to trigger smart assessment when an entity is created or updated.
Also, I have created subflow to create control and it requires inputs such as Entity and Control Objective. I will be passing Control Objective as hard coded, but entity should be passed from Smart Assessment as on which trigger has raised against the entity. So I am trying to pass the entity from the smart assessment template, but it is not available.
Can you guide me how to pass smart assessment template input inside the subflow which triggers during post automation.
Summary what I am trying below:
1) Created Smart assessment with questions and answers
2) Created flow to trigger the assessment when the entity is created/updated
3) Created subflow to create control
4) Selected the subflow from step (3) in Automation
Challenge: I want to pass the Entity so that Control will be created on that entity.
Please let me know if anyone have tried this approach.
Thanks, Sunil Safare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Not sure if anyone has tried to create controls via assessment, as controls get usually created by entites / entity types.
But: You should be able to define the Entity as assessment target:
Also you might want to add a new "purpose", as some of the categories still are used to trigger flows, even if the field category in a template is "deprecated".
If you then assign the automation to your assessment you can find the entity here:
Hope this will help.
kind regards
and "accepted solutions"This motivates others to take part, post solutions and find answers. Thanks! - Mat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Matthias,
In the second screen shot, you have put the second part where it is displaying options "Response based" and "Scope based". I cannot see them in my action, I can simply see to select the drop downs from the defined subflows. Where can I see those options. Please elaborate.
Thanks, Sunil Safare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi again
Based on your response i think you are talking about this dropdown.
Select The Subflow
Note: In my case the input of my subflow was named "Control" as it is a control that needs to be passed to the subflow i selected. You should see "entity" (given the name of the subflow input variable that you defined in the subflow is "entity").
Now click on that wand-symbol right of that field:
Et voila!
You NEED to define Entity as assessment target in step one (createion of template) as mentiones earlier, to see the "scoped based" selection.
Dont forget to accept the answer if that helped 😉 Thanks
and "accepted solutions"This motivates others to take part, post solutions and find answers. Thanks! - Mat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@Sunil25 - Instead of trying to pass the Entity directly from the Post Automation configuration, pass an available assessment context object (such as the Assessment Instance or Assessment Result, depending on what is exposed to your subflow) and then retrieve the associated Entity within the subflow logic.
Typical flow:
- Entity created/updated
- Flow launches Smart Assessment
- Assessment completed
- Post-assessment automation calls Subflow
- Subflow receives assessment context
- Subflow queries the assessment record to determine the source Entity
- Create Control against that Entity
Verify Available Data Pills
In your subflow definition:
- Add an input for the assessment context record (if available).
- Check the data pills exposed by Post Assessment Actions.
- Often the triggering entity is stored as a reference on the assessment instance/subject record and can be retrieved in a Flow Designer action or Script step.
Important Check
Make sure the subflow is properly linked to the Template Category, otherwise only limited inputs/actions may be exposed in the automation configuration. ServiceNow specifically requires subflows to be linked to the template category before they can be used in Post-Assessment Actions. [github.com], [servicenow.com]
If Entity Is Not Available at All
A workaround is to:
- Pass the Assessment Instance ID into the subflow.
- Use a "Look Up Record" step or Script step.
- Read the entity reference from the assessment instance table.
- Use that Entity sys_id when creating the Control record.