Skip to main content

forms

Creates, updates, deletes, gets or lists a forms resource.

Overview

Nameforms
TypeResource
Iddatadog.service_management.forms

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)The ID of the form. (example: 22f6006a-2302-4926-9396-d2dfcf7b0b34)
attributesobjectThe attributes of a form.
typestringThe resource type for a form. (forms) (default: forms, example: forms)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_formselectform_idversionGet a form definition by its ID.
list_formsselectGet all forms for the authenticated user's organization.
create_forminsertdataCreate a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form.
update_formupdateform_id, dataUpdate a form's properties such as its name, description, or datastore configuration.
delete_formdeleteform_idDelete a form by its ID. This will also try to delete the associated datastore.
create_and_publish_formexecdataCreates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form.
clone_formexecform_id, dataClone an existing form. The clone is created in draft mode using the source form's latest version.
publish_formexecform_id, dataPublish a specific version of a form, making it available for submissions.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
form_idstring (uuid)The ID of the form. (example: 22f6006a-2302-4926-9396-d2dfcf7b0b34)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
versionstringThe version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number.

SELECT examples

Get a form definition by its ID.

SELECT
id,
attributes,
type
FROM datadog.service_management.forms
WHERE form_id = '{{ form_id }}' -- required
AND version = '{{ version }}'
;

INSERT examples

Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form.

INSERT INTO datadog.service_management.forms (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

UPDATE examples

Update a form's properties such as its name, description, or datastore configuration.

UPDATE datadog.service_management.forms
SET
data = '{{ data }}'
WHERE
form_id = '{{ form_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a form by its ID. This will also try to delete the associated datastore.

DELETE FROM datadog.service_management.forms
WHERE form_id = '{{ form_id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form.

EXEC datadog.service_management.forms.create_and_publish_form
@@json=
'{
"data": "{{ data }}"
}'
;