---
keyword: [Graph API, mutations, mutation prompts]
nav: wcp_docs
parent_url: /wcp_docs/
title: Input Prompt Values for Mutations
layout: subsection
---

## <a id="section_x1n_x1n_f1b"></a>Overview

The `prompts` query in the Graph API schema contains `Mutation_Prompts`, which provides fields corresponding to input prompt values for their respective [Graph API Mutations](/wcp_docs/kbu1671067116723.html). You can query the input prompt values for Workday ID fields, which you can use in the input data of a mutation. Like the multilevel lookup prompts in Workday, input prompt values can have 1 or more levels. Each level is a filtered set of values, which can be either the final (leaf-node) values or have more nested values.

You can specify either of these query arguments for the input prompt values:

-   `promptPath` - A list containing a sequence of Workday ID values that form the path to the leaf-node values. Use the `promptPath` query argument if you want to iteratively retrieve multilevel prompt values. See [Getting Multilevel Input Prompt Values](/wcp_docs/GUID-285d95ca-d2d1-4e0a-b7df-7e4d9c345240-enHYPHENus.html#section_gettingMultilevelInputPromptValues)
-   `search` - A search string that matches the descriptor values at any level. Use the `search` query argument if you want to search the descriptor values across all nested levels. See [Searching Input Prompt Values](/wcp_docs/GUID-285d95ca-d2d1-4e0a-b7df-7e4d9c345240-enHYPHENus.html#section_searchingInputPromptValues)


<b>Note:</b> If you specify both <b>promptPath</b> and <b>search</b>, we use the <b>search</b> query argument and ignore <b>promptPath</b>.

## <a id="section_findingInputPromptValues"></a>Finding Input Prompt Values for a Mutation

To determine whether a mutation has available input prompt values:

1.  In Graph API Explorer, open the Documentation Explorer.
2.  Search for the name of the mutation.

    Example: Search `submitAccountingJournal`.

3.  If the search results include `Mutation_Prompts` with the mutation name, select it.

    `Mutation_Prompts.someMutation` indicates that <i>someMutation</i> has available input prompt values.

    Example: `Mutation_Prompts.submitAccountingJournal` indicates that the `submitAccountingJournal` mutation has input prompt values.

4.  Select the request input prompts type.

    Example: For the `submitAccountingJournal` mutation prompt, select `SubmitAccountingJournal_SubmitAccountingJournalRequestInput_WSPrompts`.

5.  Select the data input field type.

    Example: For the `accountingJournalData` input field, select `SubmitAccountingJournal_AccountingJournalDataInput_WSPrompts`.



The data input field type lists the available input prompt values for the ID fields that you can use in the mutation input data. Example: <i>bookCodeReference</i>, <i>companyReference</i>, <i>currencyReference</i>, and others.

<b>Note:</b> Although the names of the ID fields use the <i>Reference</i> suffix, they return Workday IDs, not custom reference IDs.

Each ID field returns the list of the input prompt values, with each instance containing these fields:

-   `id`: The Workday ID of an instance.
-   `descriptor`: The name of an instance.
-   `isFinalResult`: If <i>false</i>, the `id` is the Workday ID of a category, which contains nested values. If <i>true</i>, the `id` is the Workday ID of the leaf-node value.

    Always get the `isFinalResult` field when you use the `promptPath` query argument.



<b>Note:</b> In the <b>Generate Query</b> tool of the Graph API Explorer, you can search for the `prompts` query. When you select the `prompts` query, the generated query includes all mutation prompts. If you increase the <b>Generated Depth</b> to 5, the generated query includes all available ID fields for each mutation prompt.

## <a id="section_gettingMultilevelInputPromptValues"></a>Getting Multilevel Input Prompt Values

Similar to selecting multilevel lookup prompts in Workday, you can iteratively run queries that get values at the root level, each nested category level (or “folder”), and finally the leaf-node level.

To get multilevel input prompt values:

1.  Run the initial `prompts` query for an ID field in the input data of the mutation.

    Example: Run this `prompts` query on the `companyReference` field in the `accountingJournalData of the submitAccountingJournal` mutation.

    ```
    query {
      prompts{
        mutation{
          submitAccountingJournal{
            accountingJournalData{
              companyReference{
                  data{
                  id
                  descriptor
                  isFinalResult
                }
              }
            }
          }
        }
      }
    }
     
    ```

    The `"isFinalResult": false` field indicates that the values are categories and that they have nested values.

2.  If the `isFinalResult` field returns <i>false</i>, run the query again with the `promptPath` argument containing the ID of a specific category.

    Example: Let's get the nested values for the <i>Companies by Hierarchies</i> category, whose `id` is 5934e763ba3610001626be5bea820009. Specify the `id` of Companies by Hierarchies in the ``promptPath[]`` `argument for company_Reference`.

    ```
    query {
      prompts{
        mutation{
          submitAccountingJournal{
            accountingJournalData{
              companyReference (promptPath: ["5934e763ba3610001626be5bea820009"]){
                  data{
                  id
                  descriptor
                  isFinalResult
                }
              }
            }
          }
        }
      }
    }
     
    ```

    The `"isFinalResult": false` field indicates that the values are also categories and that they also have nested values.

    ```
    {
      "data": {
        "prompts": {
          "mutation": {
            "submitAccountingJournal": {
              "accountingJournalData": {
                "companyReference": {
                  "data": [
                    {
                      "id": "3378ccbf59401003f0032fa690c20000",
                      "descriptor": "All Companies Hierarchy",
                      "isFinalResult": false
                    },
                    {
                      "id": "4d10b332adc4100c2aa709f4b4ba0000",
                      "descriptor": "All GMS",
                      "isFinalResult": false
                    },
                    {
                      "id": "0127c9f1462810016d1edc8885de0000",
                      "descriptor": "CDC Consolidation",
                      "isFinalResult": false
                    },
                    . . .
                  ]
                }
              }
            }
          }
        }
      }
    }
     
    ```

3.  If the `isFinalResult` field returns <i>false</i> again, run the query again with the `promptPath` argument, adding the `id` of the subcategory.

    The sequence of IDs in the `promptPath` argument specifies the path to the values at the next level.

    Example: Let's get the nested values for the All GMS subcategory, whose `id` is 4d10b332adc4100c2aa709f4b4ba0000. Sequentially specify the `id`s of Companies by Hierarchies and All GMS in the `promptPath[]` argument for `company_Reference`.

    ```
    query {
      prompts{
        mutation{
          submitAccountingJournal{
            accountingJournalData{
              companyReference (promptPath: ["5934e763ba3610001626be5bea820009", "4d10b332adc4100c2aa709f4b4ba0000"]){
                  data{
                  id
                  descriptor
                  isFinalResult
                }
              }
            }
          }
        }
      }
    }
     
    ```

4.  If the `isFinalResult` field returns true, the values are leaf-node values, which don’t contain any more nested values.

    The sample returned values containing `"isFinalResult": true`, which indicates that these values are the leaf-node values.

    ```
    {
      "data": {
        "prompts": {
          "mutation": {
            "submitAccountingJournal": {
              "accountingJournalData": {
                "companyReference": {
                  "data": [
                    {
                      "id": "f911ef555a0201658a67f6086a25c608",
                      "descriptor": "Company History",
                      "isFinalResult": true
                    },
                    {
                      "id": "cb550da820584750aae8f807882fa79a",
                      "descriptor": "Global Modern Services, Inc. (USA)",
                      "isFinalResult": true
                    },
                    . . .
                  ]
                }
              }
            }
          }
        }
      }
    }
     
    ```

5.  Once you have the final values, you can select the `id` value you need in the corresponding field of the mutation input data.


## <a id="section_searchingInputPromptValues"></a>Searching Input Prompt Values

Similar to searching with lookup prompts in Workday, you can use the `search` query argument to perform a string search on the descriptors across all levels of the input prompt values.

This sample prompts query searches the companyReference input prompt values for “gms ireland”:

```
query {
    prompts{
    mutation{
      submitAccountingJournal{
        accountingJournalData{
          companyReference(search:"gms ireland"){
              total
            data{
              id
              descriptor
              isFinalResult
            }
          }
        }
      }
    }
  }
}
 
```

Sample resonse:

```
{
  "data": {
    "prompts": {
      "mutation": {
        "submitAccountingJournal": {
          "accountingJournalData": {
            "companyReference": {
              "total": 1,
              "data": [
                {
                  "id": "2de552bf69d5402e8f04ab38eaeab042",
                  "descriptor": "Global Modern Services Ltd. (Ireland)",
                  "isFinalResult": true
                }
              ]
            }
          }
        }
      }
    }
  }
}
 
```

