---
schema_version: "1"
id: 4aeb9577bcd799f599805079cde83657db8b60fd92d556ffb82c12194a176f6d
title: Quick Start
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-code-ext/guides/function/quickstart-custom-chunking.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/quickstart-custom-chunking.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 47cdf84c439171508c5e3cfc8af21c458d34b965653ea541dcfb65bcdcab4d8b
products:
  - Data 360 Code Extension Guide
  - Data 360 Developer Documentation
---
# Quick Start

Create a function package, run and validate it locally, deploy it to Data 360, use it as the chunking strategy in a search index, and then verify chunked results in Data Explorer or with a retriever in Prompt Builder.

This quick start uses the default function in `payload/entrypoint.py` and validates it with `payload/tests/test.json`, which is a local input payload containing DocElements with `text` and `metadata`. The local run returns chunk output fields such as `chunk_type`, `text`, `seq_no`, and optional `citations`.

**Estimated time: ~25 minutes.**

| Edition Table                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Available in: **Developer**, **Enterprise**, **Performance**, and **Unlimited** Editions. See [Data 360 edition availability](https://help.salesforce.com/s/articleView?id=sf.c360_a_dc_editions.htm&type=5). |

| Permission Sets Needed                           |                                                        |
| ------------------------------------------------ | ------------------------------------------------------ |
| To run the sample chunking function in Data 360: | Permission set: <ul><li>Data Cloud Architect</li></ul> |

## Step 1: Access a Data 360 Org

Make sure that you have access to a Data 360 org with appropriate permission sets. If you do not have a sandbox, create one. See [Create a Data 360 Sandbox](https://help.salesforce.com/s/articleView?id=data.c360_a_data_cloud_sandbox_create.htm&type=5).

Enable Code Extension in Data Cloud Setup by using Feature Manager. See [Enable Data 360 Features in Feature Manager](https://help.salesforce.com/s/articleView?id=data.c360_a_feature_manager.htm&language=en_US&type=5).

## Step 2: Set Up Salesforce CLI for Custom Functions

Install the Salesforce CLI and the code extension plugin, install the Data Cloud Custom Code Python SDK, authenticate to your org, and initialize a function package. See [Set Up Salesforce CLI for Custom Functions](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/set-up-sdk-for-functions.md).

## Step 3: Build Your Function Package

1. Go to your function package directory.

   ```bash
   cd <function-package-name>
   ```

2. Run the function package locally with sample test input.

   ```bash
   sf data-code-extension function run --entrypoint ./payload/entrypoint.py --test-with ./payload/tests/test.json
   ```

3. Refresh package metadata from the package root.

   ```bash
   sf data-code-extension function scan --entrypoint ./payload/entrypoint.py
   ```

## Step 4: Deploy Your Custom Function to Data 360

```bash
sf data-code-extension function deploy --name <name> --package-version <version> --description "<description>" --package-dir ./payload --target-org <myorg>
```

## Step 5: Use Your Function in a Search Index

Create a search index with Advanced Setup and select your custom chunking function for the fields you want to chunk. See [Use a Custom Chunking Function in a Search Index](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/use-chunking-in-search-index.md).

## Step 6: Verify Chunking Results

After the search index runs and reaches a Ready status, verify the chunked data in Data Explorer or by using a retriever in Prompt Builder. See [Verify Custom Chunking Results](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/verify-chunking-results.md).

## See Also

- [Write a Custom Chunking Function](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/write-custom-chunking-function.md)
- [Use Custom Functions in Data 360](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/use-custom-function.md)
- [Deploy a Custom Function to Data 360 Sandbox by Using CLI](https://developer.salesforce.com/docs/data/data-cloud-code-ext/guide/deploy-custom-function-cli.md)
- [Query Code Extension Logs by Using Query Editor](https://developer.salesforce.com/docs/data/data-cloud-code-ext/query-logs-queryeditor.md)
