---
title: "connectToSalesforce"
canonical: "https://support.appfire.com/space/PSJ/15480269/connectToSalesforce"
format: markdown
---
> Macro (aura-html)


# <span style="color: #bd5528">Syntax</span>

**<span style="color: #3366ff">connectToSalesforce(connectionName)</span>**

## Description

> Macro (excerpt)
> 
> Establishes a connection to Salesforce.

This is done using a connection that was [previously defined](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15482415) and configured on the SFDC Configuration page.

> ⚠️ All fields that describe a SFDC connection configuration are required.

![image](media://8c2651ea-b7eb-47a2-a122-370f5b7a7772)

  


## <span style="color: #bd5528">Parameters</span>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| connectionName | string | Yes | The name of the Salesforce connection as defined in the SFDC Configuration page. |

## Return type

[SFDCConnection](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15482612) - predefined structure type

### Example

```
SFDCConnection conn = connectToSalesforce("SFDC_test");
logPrint("WARN", "Connected to SF: " + conn.instance_url + " - " + conn.access_token);
```

## See also

> Macro (contentbylabel)