---
schema_version: "1"
id: d8d70378e578a1f12a7c5cb6c30b896b934c894ca08e5a66fbf371ded00b9d18
title: AgentforceDataProviding
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/ios/agentforce-data-providing-ios.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-data-providing-ios.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 96212fd731696ef472c67572247369735539954b9b020bc86b3fed2508ea0a14
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforceDataProviding

## Overview

Protocol for providing data access functionality to the Agentforce SDK. This protocol serves as the bridge between the Agentforce SDK and your application's data layer, typically connecting to Salesforce APIs. Implementations should provide access to Salesforce records, object metadata, and query capabilities while respecting security, caching, and performance requirements.

## Declaration

```swift
protocol AgentforceDataProviding
```

## Methods

| Method                                                               | Signature                                                                                                                                                                                        | Description                                                           |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
| `objectInfo(for:cachePolicy:transactionId:)`                         | `func objectInfo(for: String, cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> AgentforceObjectRepresentation`                                                        | Retrieves metadata information for a Salesforce object type           |
| `objectInfos(forObjectTypes:cachePolicy:transactionId:)`             | `func objectInfos(forObjectTypes: [String], cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> [AgentforceUIAPIObjectInfo]`                                             | Retrieves metadata information for multiple Salesforce object types   |
| `query(for:cachePolicy:transactionId:)`                              | `func query(for: AgentforceQueryData, cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> [String: Any]`                                                                 | Executes a query and returns matching records                         |
| `record(for:recordId:fields:cachePolicy:transactionId:)`             | `func record(for: String, recordId: String, fields: [String], cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> AgentforceRecordRepresentation`                        | Retrieves a single record with specified fields                       |
| `record(forLayoutType:recordId:modes:cachePolicy:transactionId:)`    | `func record(forLayoutType: String, recordId: String, modes: [AgentforceAccessMode], cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> AgentforceRecordRepresentation` | Retrieves a single record using layout-based field selection          |
| `records(forLayoutType:recordIds:modes:cachePolicy:transactionId:)`  | `func records(forLayoutType: String, recordIds: [String], modes: [AgentforceAccessMode]?, cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> [AgentforceUIAPIRecord]`   | Retrieves multiple records using layout-based field selection         |
| `records(forObjectType:recordIds:fields:cachePolicy:transactionId:)` | `func records(forObjectType: String, recordIds: [String], fields: [String], cachePolicy: AgentforceCachePolicy, transactionId: String?) async throws -> [AgentforceUIAPIRecord]`                 | Retrieves multiple records with specified fields in a batch operation |
