# Salesforce Marketing Cloud

## Authentication methods

Marketing Cloud uses a complicated mix of credentials and keys, depending on which features you use:

[OAuth for APIs, SFTP for file transfer with GPG on outbound](/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-and-gpg-payload-encryption.md)

[OAuth for APIs, SFTP for file transfer](/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-without-payload-encryption.md)

[OAuth for APIs, Cloud Storage for file transfer](/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-without-payload-encryption-1.md)

## Inbound Syncs

The following are available as inbound streams:

* Data Extensions (Full Refresh only)
* Journey History (Incremental only, beginning 30 days prior to sync start)

## Outbound Syncs

### Supported Targets

* Data Extensions

### Supported Sync Strategies

* Upsert (performs an AddAndUpdate import operation)
* Update (performs an UpdateButDoNotAdd import operation)
* Create (performs an AddAndDoNotUpdate import operation)
* Replace (performs an Overwrite import operation). Note that although Salesforce does not require a primary key for this operation, Omnata Push still requires one in order to properly track the full life cycle of records over time.

These operations are described [here](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/importdefinitionupdatetype.html).

## Functions

### FETCH\_DATA\_EXTENSIONS

Fetches a list of Data Extensions.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```sql
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTENSIONS(
                'my-sfmc-connection'));
```

### FETCH\_DATA\_EXTENSION\_RECORDS

Fetches records from a Data Extension.

Note that currently this function requires a connection method with FTP credentials.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection
* DATA\_EXTENSION\_NAME (VARCHAR): The name of the data extension

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTENSION_RECORDS(
                'my-sfmc-connection',
                'My Data Extension'));
```

### FETCH\_DATA\_EXTRACT\_DEFINITION

Fetches an individual data extract definition.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection
* DEFINITION\_ID (VARCHAR): The ID of the data extract definition

Examples:

```
select OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_DEFINITION(
                'my-sfmc-connection',
                'a1bcda25-8359-4c32-9876-452c530c196a');
```

### FETCH\_DATA\_EXTRACT\_DEFINITIONS

Fetches all data extract definitions.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_DEFINITIONS(
                'my-sfmc-connection'));
```

### FETCH\_DATA\_EXTRACT\_TYPES

Fetches all data extract types.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_TYPES(
                'my-sfmc-connection'));
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
