> For the complete documentation index, see [llms.txt](https://docs.mydbsync.com/cloud-workflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mydbsync.com/cloud-workflow/troubleshooting/page-2/sync-error-due-to-special-character-in-a-field.md).

# Sync Error Due to Special Character in a Field

Unexpected unexpected token: 's'' extendedErrorDetails='{\[0]}'] row='1' column='43']]”&#x20;

#### Summary

This article explains how to identify and resolve the issue by updating the mapping accordingly in DBSync.

```
Unexpected unexpected token: 's'' extendedErrorDetails='{[0]}'] row='1' column='43']]” ,
```

#### Problem

If a special character is used in any field while syncing, you will get an error message&#x20;

```
Unexpected unexpected token: 's'' extendedErrorDetails='{[0]}'] row='1' column='43']]
```

For example:&#x20;

The problem is caused by this part:

Name='"+VALUEATTR("CustomerRef","name")+"'"

If the value of CustomerRef.name contains an apostrophe (for example, Joe's Garage), it breaks the SOQL string because the single quote ' ends the string prematurely. This is the error:

```
Unexpected unexpected token: 's'' at column 43
```

is pointed out.

Error in mapping at Target field \[Account\_\_c] : \[MalformedQueryFault \[ApiQueryFault \[ApiFault exceptionCode='MALFORMED\_QUERY' exceptionMessage='from Account where Name='Joseph's Project -Catholic Charities of ^ERROR at Row:1:Column:43 unexpected token: 's'' extendedErrorDetails='{\[0]}'] row='1' column='43']]&#x20;

#### Applies To

**Product/Service**: DBSync Cloud Workflow

**Versions**: All versions supporting Salesforce-QBO integration

**Operating Systems**: Platform-independent (Cloud-based)

**Databases / Connectors**: Salesforce, QuickBooks Online

**Applicable To**: Quickbooks&#x20;

#### Solution / Steps

**Prerequisites**:

* Admin access to DBSync
* Mapping access for the integration project

**Steps**:

1. Log in to DBSync and open the Integration Project used for syncing data to QBO.
2. Go to the Field Mapping section where ID is mapped.
3. Check the logic used for mapping. You’ll find something like:

Old Mapping:

```
TLOOKUP("Select Id from Account where Name='"+VALUEATTR("CustomerRef","name")+"'") ]
```

4. Log in
5. Update the mapping by adding ESCAPESPECIALCHARACTER

New Mapping:

```
TLOOKUP("Select Id from Account where Name='"+ESCAPESPECIALCHARACTER(VALUEATTR("CustomerRef","name"))+"'")
```

6. Save the mapping and re-run the sync.

Verify that the previously erroneous records are now syncing successfully.

#### Workaround (If Applicable)

Remove the special character from the name.

#### Root Cause

This points to an unexpected character or quote, probably due to a mismatched or unescaped apostrophe (') in a string.

```
Unexpected unexpected token: 's'' at row='1' column='43'
```

#### Additional Information / Related Articles

<https://salesforce.stackexchange.com/questions/115044/unexpected-token-or?utm_source>

[https://developer.salesforce.com/docs/atlas.en-us.soql\_sosl.meta/soql\_sosl/sforce\_api\_calls\_soql\_select\_quotedstringescapes.htm](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_quotedstringescapes.htm?utm_source)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.mydbsync.com/cloud-workflow/troubleshooting/page-2/sync-error-due-to-special-character-in-a-field.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
