---
schema_version: "1"
id: adc820ec52eb9e21e0cab85c859620cbb600d34724fc8c136f936b7f5d681db3
title: UpsertContext Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_UpsertContext.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_UpsertContext.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 858d8a901a9a80c9b11b874e5f587bcf557e4784f822444d11b2ff283804f74e
description: An instance of UpsertContext is passed to the upsertRows() method on your Datasource.Connection class. This class provides context information about the upsert request to the implementor of upsertRows().List of rows corresponding to the external object records to upsert.The name of the table to upsert rows in.
---
# UpsertContext Class

An instance of UpsertContext is passed to the upsertRows() method on your Datasource.Connection class. This class provides context information about the upsert request to the implementor of upsertRows().

## Namespace

[DataSource](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_DataSource.htm "The DataSource namespace provides the classes for the Apex Connector Framework. Use the Apex Connector Framework to develop a custom adapter for Salesforce Connect. Then connect your Salesforce organization to any data anywhere via the Salesforce Connect custom adapter.")

## Usage

The Apex Connector Framework creates the contet for operations. Context is comprised of parameters about the operations, which other methods can use. An instance of the UpsertContext class packages these parameters into an object that can be used when an upsertRows() operation is initiated.

- **[UpsertContext Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_UpsertContext.htm#apex_DataSource_UpsertContext_properties)**

## UpsertContext Properties

The following are properties for UpsertContext.

- **[rows](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_UpsertContext.htm#apex_DataSource_UpsertContext_rows)**  
    List of rows corresponding to the external object records to upsert.
- **[tableSelected](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_UpsertContext.htm#apex_DataSource_UpsertContext_tableSelected)**  
    The name of the table to upsert rows in.

### rows

List of rows corresponding to the external object records to upsert.

#### Signature

public List<Map<String,ANY>> rows {get; set;}

#### Property Value

Type: List<Map<String,Object>>

### tableSelected

The name of the table to upsert rows in.

#### Signature

public String tableSelected {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")