/datasets/activity/{datasetId}/fields

Obtain a detailed list of fields and field groups for a given activity.

Prerequisite

Resource URL

/v2/applications/{communityApiKeyName}/datasets/activity/{datasetId}/fields
Note:

Use the appropriate regional endpoint to ensure that you comply with your organization's privacy policy, and applicable laws and regulations. For details about the available regional endpoints, and how to identify your organization's region, see API Access.

Available methods

Method Description
GET Obtain a list of fields and field groups for a Community survey or power survey.

Available fields

Table 1. Elements under the fields attribute
Element Description
dataType The type of data answer values are stored as. Possible values are:
  • string: The value is stored as text.
  • double: The value is stored as numeric.
  • datetime: The value is stored as date-time.
  • identifier: The value is stored as a text identifier.
  • enum: Allows the choice of a single value from a list of possible values.
  • set: Allows the choice of multiple values from a list of possible values.

This element can be found under the property container type.

description The question text of a survey question.
id The field's GUID.
isRequired This element is returned as true if the question was specified as required during survey authoring. Otherwise, it is omitted.

This element can be found under the property container meta.

isSensitive The value determines whether the field contains sensitive data. Possible values are:
  • true
  • false
isSystem The value determines whether it is a system question. Possible values are:
  • true
  • false

This element can be found under the property container meta.

name The name of the survey question.
Note: The survey question name is appended if it is one of the following question types:
  • Grid questions are appended with the row name.
  • Choice questions with other-specify options are appended with the answer option name.

For more information, see Extract Activities.

values The options of a survey question.
Note: values are only applicable to enum and set data types.
  • id: The GUID of the answerId, otherwise known as the question option.
  • name: The text value of a question option.

This element can be found under the property container type.

visibility The visibility setting of the question. Possible values are:
  • active
  • hidden

This element can be found under the property container meta.

Table 2. Elements under the fieldGroups attribute
Element Description
description The question text of a survey question.

This element can be found under the property container meta.

fieldIds The list of field IDs included in the field group.
id The field group's GUID.
name The name of the survey question associated with the field group.
Example

A response payload for a Single Choice Grid question with three rows and four answer option columns:

{
    "fields": [
        {
          {
            "id": <GUID of the field associated with row 1>,
            "name": <the question name_name of row 1>,
            "type": {
                "dataType": <enum|string|double|datetime|identifier|set>,
                "values": [
                    {
                        "id": <GUID of column 1>,
                        "name": <text from column 1>
                    },
                    {
                        "id": <GUID of column 2>,
                        "name": <text from column 2>
                    },
                    {
                        "id": <GUID of column 3>,
                        "name": <text from column 3>
                    },
                    {
                        "id": <GUID of column 4>,
                        "name": <text from column 4>
                    }
                ]
            },
            "isSensitive": <true|false>,
            "meta": {
               "description": <question text>
               "visibility": <active|hidden>
               "isSystem": <true|false>
               "isRequired": <true|(omitted)>
            }
        },
          {
            	"id": <GUID of the field associated with row 2>,
            	"name": <the question name_name of row 2>,
            	"type": {
                "dataType": <enum|string|double|datetime|identifier|set>,
                "values": [
                    {
                        "id": <GUID of column 1>,
                        "name": <text from column 1>
                    },
                    {
                        "id": <GUID of column 2>,
                        "name": <text from column 2>
                    },
                    {
                        "id": <GUID of column 3>,
                        "name": <text from column 3>
                    },
                    {
                        "id": <GUID of column 4>,
                        "name": <text from column 4>
                    }
                ]
            },
            "isSensitive": <true|false>,
            "meta": {
               "description": <question text>
               "visibility": <active|hidden>
               "isSystem": <true|false>
               "isRequired": <true|(omitted)>
            }
        },
          {
            	"id": <GUID of the field associated with row 3>,
            	"name": <the question name_name of row 3>,
            	"type": {
                "dataType": <enum|string|double|datetime|identifier|set>,
                "values": [
                    {
                        "id": <GUID of column 1>,
                        "name": <text from column 1>
                    },
                    {
                        "id": <GUID of column 2>,
                        "name": <text from column 2>
                    },
                    {
                        "id": <GUID of column 3>,
                        "name": <text from column 3>
                    },
                    {
                        "id": <GUID of column 4>,
                        "name": <text from column 4>
                    }
                ]
            },
            "isSensitive": <true|false>,
            "meta": {
               "description": <question text>
               "visibility": <active|hidden>
               "isSystem": <true|false>
               "isRequired": <true|(omitted)>
            }
        }
    ],
      "fieldGroups":[
         {
            "id": <GUID of the field group>,
            "name": <question name>,
            "fieldIds":[
                <GUID of the field corresponding to row 1>,
                <GUID of the field corresponding to row 2>,
                <GUID of the field corresponding to row 3>
            ],
            "meta": {
                "description": <question text>
                "isRequired": <true|(omitted)>
            }
         }
      ]
   }