Help with Rest API Survey

vivektietkumar
Giga Contributor

Hi - I need some help with exposing Survey Response through Rest API.   I have designed a survey that has different kinds of questions like multiple choice, rank and text field. Text feild is the one that I am asking users to input comments like - This tool is bad or The tool serves the intended purpose. Please refer to the below screenshot. The string value is what captures the required info.

1.jpg

1 . I have tried the following with no success. Looked in Survey Response table through Rest API

2.jpg

2. Looked in assessment instance

23.jpg

I looked into database schemas but still not able to understand why I am not able to capture text in a string value. The assessment instance question has string value column and it's not a

reference field.

4.jpg

1 ACCEPTED SOLUTION

Hi Vivek,



I think it is returning the correct values only.



1) You have set a limit on number of records to be returned to 10 in REST Explorer (sysparam_limit). Please remove that to see if you get all records you want.



2) Your table in the 3rd snapshot shows it has values as numbers (4) also. So the String value returned as 8 or 1 can be valid.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


View solution in original post

6 REPLIES 6

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Vivek,



You need to refer to asmt_metric_result table which stores the Survey Results.



find_real_file.png




Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


Thanks But when I pick this table and runt the following Get command



5.jpg


The result I get is:



6.jpg


7.jpg



There is no entry in my table that was created in 2016 and was created by Billie.Cowley






8.jpg






9.jpg


Can you go to this table (asmt_metric_result) and check if the entries are there?


sorry for the late reply. I go to this table and open the list. I can see the user Billie.Cowley. But still my query doenst seem to get proper results. THis is my REST API explorer now:



11.jpg12.jpg



As you can see the string value returned should be ServiceNow, Sharepoint etc But its returning numbers 8 or 1. Also, created date and time here is 2017 while response shows it as 2016. What I am I doing wrong. Thanks in advance.


10.jpg