Salesforce Error: Salesforce Connector: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Salesforce Error: Salesforce Connector: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

book

Article ID: KB0078451

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

Occasionally when integrating with Salesforce, you may get an error like the one below.

The following error has occurred in the Salesforce Connector: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

This error is typically caused because of either a datatype mismatch (Insert a Char value into a Number or Int field) or because there is bad data in a source field. 

Attempting to troubleshoot this error will require some detective work by reviewing the data for the record that is failing. You can either look at the execution history and review the individual failed record, or if you have a fatal error that caused the entire solution to fail, go into the query block and preview the first 25 records to see what is being picked up for data. It helps to take a screenshot or copy down the data that you are seeing.

Next, look at the field mappings and see what the datatype and length of the source fields are compared to the fields that you are mapping to in the target. Then make sure the data being passed is correct for the datatype of the target system. Once you have identified where the issue is, you must decide, based on company standards for data, what the best approach to resolve will be. If there are just a few records that need to be corrected, correct those few records. If the data needs to remain in the current state, you may need to map into different field or adjust the target field to accept the data.

Issue/Introduction

Strange Error Occurs with an integration where records fail with an Index was out of range error.