getting-datacloud-schema
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegetting-datacloud-schema Skill
getting-datacloud-schema Skill
Overview
概述
This skill retrieves Data Lake Object (DLO) and Data Model Object (DMO) schema information from Salesforce Data Cloud using the SSOT REST API. It can list all DLOs or DMOs in an org, or retrieve detailed schema for a specific DLO or DMO.
本Skill使用SSOT REST API从Salesforce Data Cloud中检索Data Lake Object(DLO)和Data Model Object(DMO)的架构信息。它可以列出组织中的所有DLO或DMO,也可以检索特定DLO或DMO的详细架构。
When to Use
使用场景
- User wants to see all DLOs or DMOs in a Data Cloud org
- User needs field schema for a specific DLO or DMO
- User is exploring Data Cloud data structures
- User needs to understand DLO or DMO field types and metadata
- 用户希望查看Data Cloud组织中的所有DLO或DMO
- 用户需要特定DLO或DMO的字段架构
- 用户正在探索Data Cloud的数据结构
- 用户需要了解DLO或DMO的字段类型和元数据
Prerequisites
前置条件
- SF CLI installed and authenticated to target org
- Org has Data Cloud enabled
- User has appropriate Data Cloud permissions
- 已安装SF CLI并完成目标组织的身份验证
- 组织已启用Data Cloud
- 用户拥有相应的Data Cloud权限
Skill Execution
Skill执行步骤
Parameters
参数
- org_alias (required): The SF CLI org alias (e.g., 'afvibe', 'myorg')
- dlo_name (optional): Specific DLO developer name (e.g., 'Employee__dll')
- dmo_name (optional): Specific DMO developer name (e.g., 'Individual__dlm')
- org_alias(必填):SF CLI组织别名(例如:'afvibe'、'myorg')
- dlo_name(可选):特定DLO的开发者名称(例如:'Employee__dll')
- dmo_name(可选):特定DMO的开发者名称(例如:'Individual__dlm')
Step 1: Discover Connected Org
步骤1:发现已连接的组织
First, run to find out which org is connected and extract the alias to use for all subsequent calls:
sf org listbash
sf org listExample output:
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
│ │ Alias │ Username │ Org Id │ Status │
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
│ 🍁 │ myorg │ chandresh@afvidedemo.org │ 00DKZ00000b80NT2AY │ Connected │
└────┴───────┴──────────────────────────┴────────────────────┴───────────┘Extract the Alias value (e.g., ) from the output and use it as the for all subsequent calls. Use to see expired and deleted scratch orgs as well.
myorg<org_alias>--all首先,运行命令查看已连接的组织,并提取别名用于后续所有调用:
sf org listbash
sf org list示例输出:
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
│ │ Alias │ Username │ Org Id │ Status │
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
│ 🍁 │ myorg │ chandresh@afvidedemo.org │ 00DKZ00000b80NT2AY │ Connected │
└────┴───────┴──────────────────────────┴────────────────────┴───────────┘从输出中提取Alias值(例如:),将其作为后续调用中的。使用参数可查看已过期和已删除的临时组织。
myorg<org_alias>--allStep 2: Validate SF CLI Authentication
步骤2:验证SF CLI身份验证
Before making API calls, verify the org is connected:
bash
sf org display --target-org <org_alias> --jsonIf not connected, inform user to run:
bash
sf org login web --alias <org_alias>在调用API之前,验证组织是否已连接:
bash
sf org display --target-org <org_alias> --json如果未连接,请告知用户运行以下命令:
bash
sf org login web --alias <org_alias>Step 3a: Execute DLO Schema Script
步骤3a:执行DLO架构脚本
The Python scripts are bundled with this skill. They live in the subdirectory of the same directory that contains this SKILL.md file. Use the absolute path to that directory — do NOT use as that resolves relative to the current working directory, not the skill directory.
scripts/./scripts/To list all DLOs:
bash
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias>To get specific DLO schema:
bash
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias> <dlo_name>Python脚本已随本Skill打包,存放在包含本SKILL.md文件的目录下的子目录中。请使用该目录的绝对路径——不要使用,因为它会解析为当前工作目录,而非Skill目录。
scripts/./scripts/列出所有DLO:
bash
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias>获取特定DLO的架构:
bash
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias> <dlo_name>Step 3b: Execute DMO Schema Script
步骤3b:执行DMO架构脚本
To list all DMOs:
bash
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias>To get specific DMO schema:
bash
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias> <dmo_name>列出所有DMO:
bash
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias>获取特定DMO的架构:
bash
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias> <dmo_name>Step 4: Present Results
步骤4:展示结果
Parse and present the results in a user-friendly format:
For DLO List:
- Show DLO name, label, category, and ID
- Indicate total count
- Highlight DLOs with data (totalRecords > 0)
For DLO Schema:
- Show basic info (name, label, category, status)
- List all fields with:
- Field name
- Data type
- Primary key indicator
- Nullable status
- Highlight custom fields (exclude system fields like DataSource__c, cdp_sys_*)
- Show record count if available
For DMO List:
- Show DMO name, label, category, and ID
- Indicate total count
For DMO Schema:
- Show basic info (name, label, category, description)
- List all fields with:
- Field name
- Data type
- Primary key indicator
- Nullable status
- Show dataspace information if available
解析结果并以用户友好的格式展示:
DLO列表:
- 显示DLO名称、标签、分类和ID
- 标注总数
- 高亮显示包含数据的DLO(totalRecords > 0)
DLO架构:
- 显示基本信息(名称、标签、分类、状态)
- 列出所有字段,包括:
- 字段名称
- 数据类型
- 主键标识
- 可空状态
- 高亮显示自定义字段(排除DataSource__c、cdp_sys_*等系统字段)
- 若有可用数据,显示记录数
DMO列表:
- 显示DMO名称、标签、分类和ID
- 标注总数
DMO架构:
- 显示基本信息(名称、标签、分类、描述)
- 列出所有字段,包括:
- 字段名称
- 数据类型
- 主键标识
- 可空状态
- 若有可用数据,显示数据空间信息
Step 5: Offer Next Steps
步骤5:提供后续操作建议
After displaying results, suggest relevant follow-up actions:
- Query data from the DLO
- Create calculated insights
- Build segments
- Set up data streams
- Create DMO mappings
展示结果后,建议相关的后续操作:
- 从DLO中查询数据
- 创建计算洞察
- 构建细分群体
- 设置数据流
- 创建DMO映射
API Endpoints Used
使用的API端点
List All DLOs
列出所有DLO
GET /services/data/v64.0/ssot/data-lake-objectsResponse structure:
json
{
"dataLakeObjects": [
{
"name": "Employee__dll",
"label": "Employee",
"category": "Profile",
"id": "1dlXXXXXXXXXXXXXXX",
"status": "ACTIVE",
"totalRecords": 12,
"fields": [...]
}
],
"totalSize": 5
}GET /services/data/v64.0/ssot/data-lake-objects响应结构:
json
{
"dataLakeObjects": [
{
"name": "Employee__dll",
"label": "Employee",
"category": "Profile",
"id": "1dlXXXXXXXXXXXXXXX",
"status": "ACTIVE",
"totalRecords": 12,
"fields": [...]
}
],
"totalSize": 5
}Get DLO Schema
获取DLO架构
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}Response structure (same as individual object in list response, but wrapped in paginated format).
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}响应结构(与列表响应中的单个对象相同,但采用分页格式包装)。
List All DMOs
列出所有DMO
GET /services/data/v64.0/ssot/data-model-objectsResponse structure:
json
{
"dataModelObjects": [
{
"name": "Individual__dlm",
"label": "Individual",
"category": "Profile",
"id": "0dmXXXXXXXXXXXXXXX",
"fields": [...]
}
],
"totalSize": 10
}GET /services/data/v64.0/ssot/data-model-objects响应结构:
json
{
"dataModelObjects": [
{
"name": "Individual__dlm",
"label": "Individual",
"category": "Profile",
"id": "0dmXXXXXXXXXXXXXXX",
"fields": [...]
}
],
"totalSize": 10
}Get DMO Schema
获取DMO架构
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}Response structure (same as individual object in list response, but wrapped in paginated format).
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}响应结构(与列表响应中的单个对象相同,但采用分页格式包装)。
Error Handling
错误处理
Common Issues:
-
Org not connected
- Message: "Org not connected"
- Solution: Ask user to authenticate via SF CLI
-
DLO not found
- Message: "DLO 'XYZ__dll' not found"
- Solution: List all DLOs first to verify name
-
DMO not found
- Message: "DMO 'XYZ__dlm' not found"
- Solution: List all DMOs first to verify name
-
Permission issues
- Message: HTTP 403 errors
- Solution: Verify user has Data Cloud permissions
-
API version mismatch
- Current: v64.0
- Solution: Script can be updated for newer API versions
常见问题:
-
组织未连接
- 提示信息:"Org not connected"
- 解决方案:请用户通过SF CLI完成身份验证
-
DLO未找到
- 提示信息:"DLO 'XYZ__dll' not found"
- 解决方案:先列出所有DLO以验证名称
-
DMO未找到
- 提示信息:"DMO 'XYZ__dlm' not found"
- 解决方案:先列出所有DMO以验证名称
-
权限问题
- 提示信息:HTTP 403错误
- 解决方案:验证用户是否拥有Data Cloud权限
-
API版本不匹配
- 当前版本:v64.0
- 解决方案:可更新脚本以适配更新的API版本
Example Usage
使用示例
Example 1: List all DLOs
User: "Show me all DLOs in afvibe org"
Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe
4. Display formatted list of DLOsExample 2: Get specific DLO schema
User: "Get the schema for Employee__dll in afvibe"
Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe Employee__dll
4. Display field schema with types and metadataExample 3: Explore DLOs then get schema
User: "What DLOs exist in myorg and show me the schema for the Employee one"
Response:
1. Run sf org list to discover connected org alias
2. List all DLOs in myorg
3. Identify Employee__dll
4. Get detailed schema for Employee__dll
5. Present both resultsExample 4: List all DMOs
User: "Show me all DMOs in afvibe org"
Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe
4. Display formatted list of DMOsExample 5: Get specific DMO schema
User: "Get the schema for Individual__dlm in afvibe"
Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe Individual__dlm
4. Display field schema with types and metadataExample 6: Explore DMOs then get schema
User: "What DMOs exist in myorg and show me the schema for the Individual one"
Response:
1. Run sf org list to discover connected org alias
2. List all DMOs in myorg
3. Identify Individual__dlm
4. Get detailed schema for Individual__dlm
5. Present both results示例1:列出所有DLO
用户:"显示afvibe组织中的所有DLO"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 <skill_dir>/scripts/get_dlo_schema.py afvibe
4. 显示格式化的DLO列表示例2:获取特定DLO的架构
用户:"获取afvibe组织中Employee__dll的架构"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 <skill_dir>/scripts/get_dlo_schema.py afvibe Employee__dll
4. 显示包含类型和元数据的字段架构示例3:先探索DLO再获取架构
用户:"我的myorg组织中有哪些DLO,并显示Employee相关的架构"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 列出myorg组织中的所有DLO
3. 定位到Employee__dll
4. 获取Employee__dll的详细架构
5. 展示上述两项结果示例4:列出所有DMO
用户:"显示afvibe组织中的所有DMO"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 <skill_dir>/scripts/get_dmo_schema.py afvibe
4. 显示格式化的DMO列表示例5:获取特定DMO的架构
用户:"获取afvibe组织中Individual__dlm的架构"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 <skill_dir>/scripts/get_dmo_schema.py afvibe Individual__dlm
4. 显示包含类型和元数据的字段架构示例6:先探索DMO再获取架构
用户:"我的myorg组织中有哪些DMO,并显示Individual相关的架构"
响应:
1. 运行sf org list命令发现已连接的组织别名
2. 列出myorg组织中的所有DMO
3. 定位到Individual__dlm
4. 获取Individual__dlm的详细架构
5. 展示上述两项结果Output Format
输出格式
DLO List Output
DLO列表输出
Found 5 DLOs in org 'afvibe':
1. DataCustomCodeLogs__dll
Label: DataCustomCodeLogs
Category: Engagement
Records: 233
2. Employee__dll
Label: Employee
Category: Profile
Records: 12
[...]在组织'afvibe'中找到5个DLO:
1. DataCustomCodeLogs__dll
标签:DataCustomCodeLogs
分类:Engagement
记录数:233
2. Employee__dll
标签:Employee
分类:Profile
记录数:12
[...]DLO Schema Output
DLO架构输出
DLO: Employee__dll
Label: Employee
Category: Profile
Status: ACTIVE
Records: 12
Custom Fields:
• id__c (Text) - Primary Key
• name__c (Text)
• position__c (Text)
• manager_id__c (Number)
System Fields:
• DataSource__c (Text)
• InternalOrganization__c (Text)
• cdp_sys_SourceVersion__c (Text)
Next steps:
- Query data: SELECT * FROM Employee__dll LIMIT 10
- Create segment based on position field
- Set up data stream for real-time updatesDLO:Employee__dll
标签:Employee
分类:Profile
状态:ACTIVE
记录数:12
自定义字段:
• id__c(文本)- 主键
• name__c(文本)
• position__c(文本)
• manager_id__c(数字)
系统字段:
• DataSource__c(文本)
• InternalOrganization__c(文本)
• cdp_sys_SourceVersion__c(文本)
后续操作建议:
- 查询数据:SELECT * FROM Employee__dll LIMIT 10
- 基于position字段创建细分群体
- 设置数据流以实现实时更新DMO List Output
DMO列表输出
Found 10 DMOs in org 'afvibe':
1. Individual__dlm
Label: Individual
Category: Profile
2. ContactPointEmail__dlm
Label: Contact Point Email
Category: Profile
[...]在组织'afvibe'中找到10个DMO:
1. Individual__dlm
标签:Individual
分类:Profile
2. ContactPointEmail__dlm
标签:Contact Point Email
分类:Profile
[...]DMO Schema Output
DMO架构输出
DMO: Individual__dlm
Label: Individual
Category: Profile
Description: Represents an individual person
Fields:
• Id__c (Text) - Primary Key
• FirstName__c (Text)
• LastName__c (Text)
• BirthDate__c (DateTime)
Next steps:
- Query data: SELECT * FROM Individual__dlm LIMIT 10
- View DLO mappings to this DMO
- Create calculated insightsDMO:Individual__dlm
标签:Individual
分类:Profile
描述:代表独立个人
字段:
• Id__c(文本)- 主键
• FirstName__c(文本)
• LastName__c(文本)
• BirthDate__c(日期时间)
后续操作建议:
- 查询数据:SELECT * FROM Individual__dlm LIMIT 10
- 查看与此DMO关联的DLO映射
- 创建计算洞察Notes
注意事项
- DLO names always end with suffix
__dll - DMO names always end with suffix
__dlm - Field names always end with suffix
__c - System fields (DataSource__c, KQ_, cdp_sys_) are automatically added
- Primary key fields are required for DLO and DMO queries
- API supports pagination (limit/offset) for large result sets
- DLO名称始终以后缀结尾
__dll - DMO名称始终以后缀结尾
__dlm - 字段名称始终以后缀结尾
__c - 系统字段(DataSource__c、KQ_、cdp_sys_)会自动添加
- 主键字段是DLO和DMO查询的必填项
- API支持对大型结果集进行分页(limit/offset参数)
Related Skills
相关Skill
- datakit_workflow: For DMO mapping operations
- datakit_validation: For validating datakit configurations
- Use this skill before creating DMO mappings to understand source DLO structure
- datakit_workflow:用于DMO映射操作
- datakit_validation:用于验证datakit配置
- 在创建DMO映射之前使用本Skill,以了解源DLO的结构