Aug 08 2023 03:02 AM
Hello All,
May be one for the Forms/Dev Community but thought I would try here. We have a process where 4 forms are submitted weekly (Every week has 4 new forms). We currently gather responses into a SPO list and feed that in PowerBI.
A new requirement has come in that the forms (which are quizzes) also need to push the scores to SPO. We have done this with conditionals to check the text of the correct answers but the workload for this is unmanageable. I know there is a forms Api (undocumented) and we have successfully queried it to get the quiz questions, but these doesn't seem to be any info in there about the right answer.
My question is, is it possible to query the forms API to get the response points, either total or per question?
Included is the starting point, just need to know if anyone knows the URI to get what we need.
Aug 09 2023 07:00 PM - edited Aug 09 2023 07:02 PM
Use below API to get the form definition which contains the answer and points information per question -
GET https://forms.office.com/formapi/api/{TenantId}/users/{UserId}/light/forms('FormId')?$select=id,order,otherInfo,questions($expand=choices)
e.g.,
"questionInfo": "{\"Choices\":[{\"Description\":\"Option 1\",\"IsGenerated\":true,\"IsAnswerKey\":true},{\"Description\":\"Option 2\",\"IsGenerated\":true,\"IsAnswerKey\":false}],\"ChoiceType\":1,\"AllowOtherAnswer\":false,\"OptionDisplayStyle\":\"ListAll\",\"ChoiceRestrictionType\":\"None\",\"ShowRatingLabel\":false,\"Point\":10}",
Use below API to get the aggregated results which contains responses and total score -
GET https://forms.office.com/formapi/api/{TenantId}/users/{UserId}/forms('FormId')/GetAggregateQuizData
e.g.,
"quizSummaryData": {
"averageScore": 10.0,
"averageSubmitTimeSeconds": 2.0,
"count": 1
Aug 16 2023 01:07 AM
Aug 16 2023 01:11 AM
Aug 16 2023 01:13 AM
Aug 17 2023 02:35 AM
Aug 17 2023 05:21 PM
It depends on the type of form/quiz you created. If it's a personal form, the form owner's user object ID (GUID) will be used, whereas if it's a group form, the group ID will be used. You can obtain the tenant ID and user ID through the network trace when you load the form. For example, in Edge developer mode, open the form and view the network trace sent to forms.office.com. The URLs of the APIs sent to the server will contain the tenant ID and user (group) ID of your form.
Jun 17 2024 02:51 PM
@DingkunXie What is your source for this information?
Jun 17 2024 07:57 PM
Aug 13 2024 03:41 AM - edited Aug 13 2024 03:55 AM
Any idea on how to access this API using Power Automate? Recently, we've encountered problems with this API; it used to work with Power Automate but has not been functioning for the past week.
Connection: Send an HTTP request to SharePoint
{
"status": 401,
"message": "{\"error\":{\"code\":\"701\",\"message\":\"Required user login.\"}}\r\nclientRequestId: xxxxx",
"source": "https://forms.office.com/formapi/DownloadExcelFile.ashx?formid=XXXXXXX",
"errors": []
}
We attempted to use the Forms synchronized Excel file from SharePoint, but it only updates with the actual form data when accessed through a browser.
Aug 29 2024 07:59 AM
Sep 06 2024 12:19 AM
Sep 09 2024 04:18 AM
Sep 18 2024 08:28 PM
@jawadahmed My flow suddenly stopped working, it breaks at the HTTP Get block with the static forms excel link. I re-added the sharpoint connection and it still doesn't work. Does anyone know what changes Microsoft made to break this?
Sep 19 2024 05:24 AM
Oct 01 2024 06:03 AM
@dfo222 we are also experiencing this issue. It use to work but hasn't worked the past couple weeks. Nothing has changed on our end.
Oct 01 2024 06:11 AM
Oct 01 2024 07:08 AM