Magidoc

createForm
Mutation

This mutation creates a new form with all its configuration and content. The form can be used to create actions, projects, or send emails based on the target field. Form should use different input elements for different types of data.

Arguments

#

_id

Unique identifier for the form, optional one.

workspace

Non-null

The workspace ID this form belongs to.

isDraft

Whether the form is a draft. Defaults to false.

title

Non-null

The form title that will be displayed to users

externalTitle

Optional external title for the form when shared externally

externalLogo

Optional external logo URL for the form when shared externally

target

Non-null

Array of form targets that determine what happens on form submission. Must be one or more of: action, project, mapToProject, email, emailToSubmitter

description

Optional form description

confirmMessage

Optional confirmation message shown after form submission

projectId

Optional project ID this form is associated with

parentActionId

Optional parent action ID for creating sub-actions

template

Optional template ID to use for created actions

projectTemplate

Optional project template ID to use for created projects

assignees

[ String !]

Array of user IDs to assign to created actions. Defaults to ['none']

projectOwner

Optional project owner user ID

members

[ String !]!
Non-null

Array of member user IDs who can access this form. For AI Assistant: Include the current user's ID in this array if not provided.

teams = []

[ String !]

Array of team IDs who can access this form. Defaults to []

sharingType

Non-null

Form sharing type ('me', 'custom', 'everyone').

  • 'me': Only creator can access
  • 'custom': Specified members/teams can access
  • 'everyone': All workspace members can access

jsonFormData

Non-null

Form configuration and content data

setFormNameToTitle = true

Whether to include form name in generated titles. Defaults to true

setDateAndUserNameToTitle = true

Whether to include date and username in generated titles. Defaults to true

setCardNumberToTitle = true

Whether to include card number in generated titles. Defaults to true

setTemplateNameToTitle

Whether to include template name in generated titles. Defaults to false

authRequired

Whether authentication is required to submit the form. Defaults to false

allowProgressionTracking

Whether to allow tracking form submission progress. Defaults to false

allowAccessToWhitelistedDomains

Whether to restrict form access to specific email domains. Defaults to false

allowedEmailDomains

[ String !]

Array of allowed email domains when domain restriction is enabled

onlyCreatorEditable

Whether only the form creator can edit it. Defaults to false

mapToProjectId

Optional project ID to map form data to

actionsData

Array of action data configurations

receivers

Optional email receivers when form target includes 'email'

emailDynamicFields

[ String !]

Array of dynamic field names to include in email

archived

Whether the form is archived. Defaults to false

shortcuttedAt

Optional date when the form was shortcutted

draftFormId

Optional ID of the draft version of this form

publishedFormId

Optional ID of the published version of this form

Response

#

Returns Form !.

Example

#

    
  

3

    
  

3

    
  

3