Using Tokens Like a Pro

Reza Farpour
Reza Farpour
  • Updated

You've probably read through how to Use the Token Picker article and are now ready to dive into more advanced token usage. If so, you've come to the right place!

Prerequisites

There are a few general rules when using tokens that you'll need to keep in mind to ensure you get the desired outcomes:

  1. All tokens are case sensitive, the syntax itself, as well as the token variables
  2. A token must be on the same side as the node it's calling (source or destination)
  3. Always use the API Name of the field when building a token

Replace the following variables when using the tokens below:

  • <api-field-name> with the API name of the field you want the token to resolve to.
  • <node-name> with the name of the node you want the token to resolve to.
  • <synapse-name> with the exact synapse name of the synapse you want the token to resolve to.
  • <api-source-entity> with the API name of the source entity you want the token to resolve to.

See more about each type of token below:

Entity Pipeline Tokens

Use the following tokens on your Entity Pipelines.

  • {{previous.values.<api-field-name>}}
    Returns the value of the <api-field-name> field from the preceding node.
  • {{previousValue}}
    Returns the result of a field level function like Extract Domain when used in the subsequent node.
  • {{Value From <node-name>}}
    Returns the result of a field-level function like Extract Domain or Replace from the named node.
  • {{<node-name>}}
    Returns the entire record from the named node.
  • {{<synapse-name>.<api-source-entity>.<api-field-name>}}
    Returns the original value of the <api-field-name> field, which came from the named Entity and Synapse. This token can only be used on the source side of the pipeline.

Field Pipeline Tokens

Use the following tokens on your Field Pipelines.

  • {{previous}}
    Returns the value of the preceding node's output.
  • {{<node-name>}}
    Returns the value from the named node's output.
  • {{<synapse-name>.<api-source-entity>.<api-field-name>}}
    Returns the original value of the <api-field-name> field, which came from the named Entity and named Synapse. This token can only be used on the source side of the pipeline.

Post-Lookup Syncari Record Tokens

When using the Lookup Syncari Record function, you'll likely want to call the output of the lookup in a node further down the data path. Use these tokens to accomplish that.

  • {{previousLookup.values.<api-field-name>}}
    Returns the value of the <api-field-name> field from the closest previous Lookup node.
  • {{previousLookup.externalIds.<synapse-name>.<api-source-entity>}}
    Returns the external ID of the record found by the closest previous Lookup node. Specify the synapse name and entity name from the synapse's schema.
  • {{Lookup From <node-name>.values.<api-field-name>}}
    Returns the value of the <api-field-name> field from the named Lookup node.
  • {{Lookup From <node-name>.id}}
    Returns the Syncari ID of the named Lookup node.
  • {{Lookup From <node-name>.externalIds.<synapse-name>.<api-source-entity>}}
    Returns the external ID of the record found by the named Lookup node. Specify the synapse name and entity name from the synapse's schema.
  • {{previousLookup.id}}
    Returns the Syncari ID of the closest previous Lookup node.
  • {{Lookup Count From <node-name>}}
    Returns a total count of all the records found in the named Lookup. The "count" toggle must be flipped to ON in order for this to work as expected.
  • {{All Lookup Records From <node-name>}}
    Returns all records found on the named Lookup. "Find All Records" toggle must be flipped to ON in order for this to work as expected.

Post-Lookup External Record Tokens

Similar to Lookup Syncari Record Tokens above, you can use tokens to access the output of the Lookup External Records function. 

  • {{Records from <node name>}} Returns the results of the function with given node name. Lookup External Records function can return multiple rows or records. To reference fields from the external record found, use the following format: {{Records from <node name>[<result index>].values.<field api name>}}
    Here is how this token would look like for Account entity in Salesforce:
    • Suppose the Lookup External Record function was named as SFDC Lookup.
    • The value to be retrieved resides in the first row of data set returned.
    • The value to be retrieved is the value corresponding to the field Name in account which has API name as name.
    • Then the token would be: {{Records from <SFDC Lookup[0].values.name}}

Post-Custom Action Syncari Record Token

Use the below token to use the output of the Custom in a node further down the data path.

  • {{Action Result From <node-name>}} Returns the output of Custom Action with the given node name. Custom Action can return JSON response and you can use the above token to reference data inside the JSON. For example {{Action Result From <node-name>.status}} will return value of status field inside of the JSON. More details on working Action responses can be found here.

Post-Conversion Tokens

Use the following tokens after a Convert Salesforce Lead action.

  • {{convertSalesforceLead.isSuccess}}
    Returns a boolean result on the success of the lead conversion action.
  • {{convertSalesforceLead.leadId}}
    Returns the Salesforce Lead ID of the lead that got converted.
  • {{convertSalesforceLead.contactId}}
    Returns the Salesforce Contact ID of the resulting contact from the lead conversion.
  • {{convertSalesforceLead.accountId}}
    Returns the Salesforce Account ID of the account to which the resulting contact was associated.
  • {{convertSalesforceLead.opptyId}}
    Returns the new Salesforce Opportunity ID created at the time of conversion. The toggle to create an opportunity must be flipped to ON in order for this to work as expected.
  • {{convertSalesforceLead.error}}
    Returns the Salesforce error message if the lead conversion failed.

Temporary Variable Tokens

{{syncari.temp.<variable name>}}

Synapse Metadata Tokens

Access information from the synapse configuration, such as the name, id, and authorization type. 

{{synapse_<synapse-name>.<propertyName>}}
Returns the contents of the referenced field. Replace spaces in the name of the synapse with underscores.

Supported Fields

The metadata tokens support these fields:

id name status authType
oAuthRedirectUrl createdBy createdAt updatedBy
updatedAt metaConfig* authConfig**  

*metaConfig includes all of the information on the Configure page for the synapse. For example, access the Base Id in the Airtable configuration below with {{synapse_Airtable CRM.metaConfig.baseId}}.
metaConfig fields will be different for each synapse. See the individual Synapse Articles for more info on the property names specific to each synapse. 
mceclip1.png

**authConfig includes the information about the authentication. The values available are dependent on the authentication type.

Format: {{synapse_<synapse-name>.authConfig.<auth-property>}}
<auth-property> can be one of the following values:

token clientId
accessToken clientSecret
refreshToken oAuthRedirectUrl

 

Service Credentials Tokens

Access information from the service credential, such as the name, id, and credentials. 

{{serviceCredentials_<service-credential-name>.<propertyName>}}
Replace the placeholder for service credential name and property name. If service credentials have spaces in the name, replace with underscores.

<propertyName> can be one of the following values:

id serviceType
                            username                           password
clientId clientSecret
apiKey endpoint
Share this

Was this article helpful?

1 out of 1 found this helpful