---
schema_version: "1"
id: 8daa6ae25fd06145ba028d95bc74b063a5792808be8107bede3300860007bc98
title: Query Definition Functions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_queryDefinitionFunctions.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_queryDefinitionFunctions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1c2a1e3d5a89c301904b56802927cfd6a84d722f07d263d129e667bf7ae1e2b0
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Query Definition Functions

The Query Definition server-side JavaScript functions allow you to manipulate queries via server-side JavaScript in the following ways:

- Create
- Retrieve
- Update
- Delete
- Run

## Load

In your server-side JavaScript code, first load the core library using this syntax:

```
Platform.Load("core","1");
```

## Initialize

To interact with a query definition via server-side JavaScript, you must first initialize the object. The code below initializes a query definition with the external key of 'myQueryDef'.

```
var qd = QueryDefinition.Init("myQueryDef");
```

Once you initialize the query definition, you can use the applicable server-side JavaScript functions.
