Default answer from script in Assessments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 07:31 AM
We have a requirement to default some of the answers on an assessment based on values from the Assessable record. I have been playing with an option in the Assessment Metric method called “Default answer from script” which would insinuate that I could default the value in a custom script. However I put the code below in the script and some variations of it with no success. The logs seem to be printing properly with the right values but i’m not seeing the Assessment answer default to what I’m trying to set it to. I am using the "Yes/No" data type right now, but I have also tried it with String and Number with no success. Has anyone had experience with this or has any ideas about another way to set the Assessment answer default value on load?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 08:57 AM
You can use the Script method with these Data type values:
- Duration
- Number
- Percentage
I don't believe there is a way to set a default value on a Yes/No questions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 10:29 AM
Thanks for the reply. I did read this in the doc but i couldn't even get Number or Duration to work. We just want to default the answer on the assessment using the script but I can never get a value populated in the answer text box upon opening the assessment. Have you ever gotten this to work with the data types you mentioned above?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2020 12:57 AM
Hi All,
The actual_result variable, that you are setting from the Script populates the field 'Actual Value' on 'Metric Result' form but not on the Assessment form where user fills the data.
Please refer the below docs for more details -
for getting checkbox checked, set -
string_result = 'true';
Let me know if it helped
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 03:14 AM
Hi Pruthvi,
We have a requirement to prefill the assessment on 'Take Assessment' form with the last answers submitted on the business application (we are doing apm assessmnet). any idea how can we acheive this?
Thanks in advance