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

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.
1 Like

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
}

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

An addendum, it seems like the RECEIVED BY TABLET attribute is available in the GUI but not via the API.

The GUI attributes, for reference, are:

The API schema provides everything but that attribute:

+1 from me in support of this.

Field ReceivedByTabletAtUtc is going to be added in 20.05 release in both list and details endpoints for assignments

1 Like

:tada: :partying_face: :tada:

Could we also add that attribute to the GET ​/api​/v1​/assignments​/{id} endpoint? It has the same problem based on the schema below. Also, both of these endpoints is missing the RECORD AUDIO field.

image

Also added IsAudioRecordingEnabled to api. Both GET ​/api​/v1​/assignments​ and GET ​/api​/v1​/assignments​/{id} will have those fields