A mutation to create a new Roadmap or Account-level Field based on any of the following field types:
- List Field
- Multi-List Field
- Number Field
- Team Member Field
- Text Field
Number Fields can include additional information pertaining to the exact type of numeric field including currency information, numeric format and decimal places.
If roadmapID is not defined, the field created will automatically be an Account-level field. Format, decimalPlaces and currency arguments cannot be set for fields that are not of the type Numeric.
Sample Mutation 1 (Roadmap Level Numeric Field)
// Create roadmap numeric field mutation
/* Roadmap level fields are created if a roadmap ID is passed in, otherwise leaving out the roadmapID will default
to creating an account level field. Below is an example of creating a roadmap level numeric field based on currency
format */
mutation {
createField (
roadmapID: "5e4d7d53caec436c46595378"
type: number
name: "Funding (Ecommerce Roadmap)"
format: Currency
decimalPlaces: 2
currency: Dollar
) {
id
name
type
lastSaved
roadmap {
id
title
}
isAccountField
}
}
Sample Response 1 (Roadmap Level Numeric Field)
// Create roadmap numeric field mutation successful result
{
"data": {
"createField": {
"id": "5e4dab706a8b06afcece7bde",
"name": "Funding (Ecommerce Roadmap)",
"type": "Numeric",
"lastSaved": 1582148465327,
"roadmap": {
"id": "5e4d7d53caec436c46595378",
"title": "Ecommerce Roadmap"
},
"isAccountField": false
}
}
}
Sample Mutation 2 (Account Level Multi-Select Field)
// Create account level multi-select field mutation
/* Account level fields are created when roadmapID is not defined. Format, decimalPlaces, and currency arguments
can not be set for fields that are not of the type Numeric. */
mutation {
createField (
type: multiList
name: "Teams"
values: ["Team A", "Team B", "Team C"]
) {
id
name
type
isAccountField
roadmap {
id
title
}
}
}
Sample Response 2 (Account Level Multi-Select Field)
// Create account level multi-select field result
/* Roadmap returns null, because the field is not attached to a roadmap. isAccountField boolean returns true */
{
"data": {
"createField": {
"id": "5e4db06e995a503b4b68cef2",
"name": "Teams",
"type": "Multi-Select List",
"isAccountField": true,
"roadmap": null
}
}
}