Skip to main content

Attribute qualification prompts

tip

You can try out this workflow at REST API Playground.

Learn more about MicroStrategy REST API Playground here.

An attribute qualification prompt is a restrictive type prompt that allows you to filter the data of a report or document based on the qualification of multiple attributes. For example, you determine a single attribute or a list of attributes from which each user can select elements to define their report filter.

Use REST APIs to perform the following actions on attribute qualification prompts:

Create a new prompt

  1. To create an attribute qualification prompt, you must enter the required fields with the correct information, using POST /api/model/prompts.

  2. The response can change based on the request parameters provided by the caller. Use the following parameters.

    LocationNameDescription
    headerX-MSTR-authTokenThe authorization token
    headerX-MSTR-ProjectIDThe ID of the project
    headerX-MSTR-MS-ChangesetThe ID of the changeset
    queryshowExpressionAsThe parameter that specifies the format in which the response is returned.
  3. The model for the definition of an attribute qualification prompt can be represented using the fields shown below. "objectID", "dateCreated", "dateModified", and "versionId" are automatically generated.

    FieldsNameDescriptionData TypeRequired?
    informationnameThe name of the prompt. This should be a user-friendly name for identifying the prompt.string✔️
    informationsubTypeThe type of prompt. The "subType" for an attribute qualification prompt is "prompt_expression".string✔️
    informationdestinationFolderIdThe folder ID where the new prompt is saved.string✔️
    expressionTypeDifferentiates between the three expression types for an expression prompt. This field is required when the "subType" in "information" is "prompt_expression". This field should be "attribute" for attribute qualification prompts.string✔️
    titleThe title of the prompt.string
    instructionThe instruction on how to apply the prompt.string
    questiondisplayformThe displayed forms for the attribute.string
    questioncustomFormsCustom forms are only available for attribute qualification prompts defined on one attribute.string
    questionpredefinedObjectsA list of predefined attributes with "objectId", "subType", and "name".string
    questionsearchA standalone search object with "objectId", "subType", and "name". When "listAllElements" is False, "search" and "predefinedObjects" should have an XOR relationship, since only one of them has a value.string
    defaultAnswerqualificationA qualification set used to define the default answer. It follows the "tree" format of the qualification in the filter request.string
    restrictionrequiredAn indicator that specifies whether a prompt answer is required or not.boolean
    restrictionmaxElementPerSelectionThe maximum number of elements per selectioninteger
    restrictionallowPersonalAnswersAn indicator that specifies whether personal answers are allowed. It can be set to "none", "single", or "multiple".string
    restrictionminThe minimum number of qualifications that can be added.integer
    restrictionmaxThe maximum number of qualifications that can be added.integer

    Sample code for creating an attribute qualification prompt's definition is provided below.

    {
    "information": {
    "destinationFolderId": "8A1831FF494F528D02A4A8BF5FB73459",
    "subType": "prompt_expression",
    "name": "Prompt on Customer"
    },
    "title": "Prompt on Customer",
    "instruction": "Qualify on Customer",
    "expressionType": "attribute",
    "question": {
    "predefinedObjects": [
    {
    "objectId": "8D679D3C11D3E4981000E787EC6DE8A4",
    "subType": "attribute",
    "name": "Customer"
    }
    ],
    "displayForms": "custom_forms",
    "customForms": [
    {
    "objectId": "8D67A35B11D3E4981000E787EC6DE8A4",
    "subType": "attribute_form_system",
    "name": "Customer DESC 1"
    },
    {
    "objectId": "8D67A35F11D3E4981000E787EC6DE8A4",
    "subType": "attribute_form_system",
    "name": "Customer DESC 2"
    }
    ]
    },
    "restriction": {
    "required": false,
    "allowPersonalAnswers": "single",
    "min": 1,
    "max": 5
    }
    }

Update an existing prompt

  1. Update the definition of the attribute qualification prompt using PUT /api/model/prompts/{promptId}.

  2. Provide the following headers in the request:

    LocationNameDescription
    headerX-MSTR-authTokenThe authorization token
    headerX-MSTR-ProjectIDThe ID of the project
    headerX-MSTR-MS-ChangesetThe ID of the changeset
  3. In addition to the above header, you should also provide the ID of the prompt you want to update.

  4. You can modify the fields shown below. The "subType" field is not included since it cannot be modified through this REST API.

    FieldsNameDescriptionData Type
    informationnameThe name of the prompt. This should be a user-friendly name for identifying the prompt.string
    informationdestinationFolderIdThe folder ID where the new prompt is saved.string
    expressionTypeDifferentiates between the three expression types for an expression prompt. This field is required when the "subType" in "information" is "prompt_expression". This field should be "attribute" for attribute qualification prompts.string
    titleThe title of the prompt.string
    instructionThe instruction on how to apply the prompt.string
    questiondisplayformThe displayed forms for the attribute.string
    questioncustomFormsCustom forms are only available for attribute qualification prompts defined on one attribute.string
    questionpredefinedObjectsA list of predefined attributes with "objectId", "subType", and "name".string
    questionsearchA standalone search object with "objectId", "subType", and "name". When "listAllElements" is False, "search" and "predefinedObjects" should have an XOR relationship, since only one of them has a value.string
    defaultAnswerqualificationA qualification set used to define the default answer. It follows the "tree" format of the qualification in the filter request.string
    restrictionrequiredAn indicator that specifies whether a prompt answer is required or not.Boolean
    restrictionmaxElementPerSelectionThe maximum number of elements per selectioninteger
    restrictionallowPersonalAnswersAn indicator that specifies whether personal answers are allowed. It can be set to "none", "single", or "multiple".string
    restrictionminThe minimum number of qualifications that can be added.integer
    restrictionmaxThe maximum number of qualifications that can be added.integer