Export full contents of Assignments screen, both via UI and API

headquarters
api
export
(Arthur Shaw) #1

Use case: While Headquarters users can query assignments on the Assignments screen, some actions may require the user to manipulate the assignments data table outside of the Assignments screen UI. An example: if there is a report of duplicate assignments (in the user-provided identifying information), the user may want to: (a) confirm that duplicates exist; (b) if so, determine their number; © if so, compile a list of duplicate assignments to delete.

Currently, there is no mechanism for users to recover the full assignment information on the server. Unlike the reports, there is no option in the UI to export the data to a file format of the user’s choice (i.e., Excel, CSV, tab-delimited). Additionally, the API endpoint for fetching this information–GET /api/v1/assignments– does not provide the identifying questions. Instead it only returns the following attributes of assignments:

    {
      "Id": 0,
      "ResponsibleId": "00000000-0000-0000-0000-000000000000",
      "ResponsibleName": "string",
      "QuestionnaireId": "string",
      "InterviewsCount": 0,
      "Quantity": 0,
      "Archived": true,
      "CreatedAtUtc": "2019-02-28T14:41:58.445Z",
      "UpdatedAtUtc": "2019-02-28T14:41:58.445Z"
    }

Work-arounds: The only two work-arounds that I see are:

  1. Inspect the files fed to SuSo for batch assignment creation. This option is potentially problematic for two reasons. First, the files may no longer exist. Second, the files only help establish that the inputs were duplicate-free, but not that SuSo created a duplicate-free set of assignments. The latter point may be important to establish for bug reporting.
  2. Copy-paste content from the Assignments screen Paging through results, copying them, pasting them, and fixing formatting in Excel–this is tedious and error-prone.
(Arthur Shaw) #2

A small update: that the GET /api/v1/assignments/{id} endpoint provides, among lots of other data, the identifying information for the assignment with id {id}.

{
  "Answers": [
    {
      "Identity": {
        "Id": "00000000-0000-0000-0000-000000000000",
        "RosterVector": [
          0
        ]
      },
      "Answer": {}
    }
  ],
  "IdentifyingData": [
    {
      "Identity": "string",
      "Variable": "string",
      "Answer": "string"
    }
  ],
  "Id": 0,
  "ResponsibleId": "00000000-0000-0000-0000-000000000000",
  "ResponsibleName": "string",
  "QuestionnaireId": "string",
  "InterviewsCount": 0,
  "Quantity": 0,
  "Archived": true,
  "CreatedAtUtc": "2019-03-08T20:45:06.035Z",
  "UpdatedAtUtc": "2019-03-08T20:45:06.035Z"
}

My request is on the API side is for GET /api/v1/assignments to provide the following, along with other info visible for assignments in the UI.

  "IdentifyingData": [
    {
      "Identity": "string",
      "Variable": "string",
      "Answer": "string"
    }
  ]

This would return the same type of information that the same type of endpoint for interviews provides (GET /api/v1/interviews):

{
  "Interviews": [
    {
      "FeaturedQuestions": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "Question": "string",
          "Answer": "string",
          "Type": "SingleOption"
        }
      ],
      "InterviewId": "00000000-0000-0000-0000-000000000000",
      "QuestionnaireId": "00000000-0000-0000-0000-000000000000",
      "QuestionnaireVersion": 0,
      "ResponsibleId": "00000000-0000-0000-0000-000000000000",
      "ResponsibleName": "string",
      "ErrorsCount": 0,
      "Status": "Deleted",
      "LastEntryDate": "2019-03-08T20:45:06.109Z"
    }
  ],
  "Order": "string",
  "Limit": 0,
  "TotalCount": 0,
  "Offset": 0
}
(Andrew) #3

Collection of IdentifyingQuestions should be present in the api/v1/assignments in 19.04 release