- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 08:58 AM
We have a timing (?) problem when retrieving the results of an employee form from "asmt_metric_result".
The scenario:
- An HR Task of type "collect employee info" is created
- The employee form contains 3 questions with metric datatype "String" and 1 question with metric datatype "attachment" - all questions are mandatory
- An async Business Rule is triggered when the HR Task changes to "closed complete"
- The Business Rule retrieves the result records from "asmt_metric_result" and does its magic
This works on a PDI, but on our DEV instance we are encountering...
The problem:
- we are unable to retrieve all results because the records on "asmt_metric_result" don't exist yet when the task is completed
- to verify, we are calling two GlideAggregates when our BR fires - one counts records on "asmt_assessment_instance_question", the other on "asmt_metric_result"
- there should be one result record for each question record, that is: 4 questions and 4 results
- however, we're seeing 4 questions records and 1 result record - this is always the "attachment" question
What is causing this delay in the creation of the records on "asmt_metric_result"?
How can we know when to collect the results, if not by looking at the state of the parent task?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 09:17 AM
Hi, a quick follow up: We opened a case with ServiceNow regarding this behavior, and the outcome was: That's just how it is designed. In other words, if you want to know when all results for an assessment have been written, you're out of luck. There's no state change you can watch, and no events are emitted.
Our solution to this was to move the actions we want to perform on the results to a Flow - which creates so much overhead that by the time our Flow action triggers, all results have been written. This might fail if you have an assessment with a large number of questions, but it's the best option you have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2024 01:25 PM
I had a similar situation, and this approach using a Script Action to handle the processing appears to be a viable solution, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2023 09:17 AM
Hi, a quick follow up: We opened a case with ServiceNow regarding this behavior, and the outcome was: That's just how it is designed. In other words, if you want to know when all results for an assessment have been written, you're out of luck. There's no state change you can watch, and no events are emitted.
Our solution to this was to move the actions we want to perform on the results to a Flow - which creates so much overhead that by the time our Flow action triggers, all results have been written. This might fail if you have an assessment with a large number of questions, but it's the best option you have.