Explore Experience programs and schemas
Experience Programs establish a referential data structure essential for other products and services. For example, Profiles use one or more Experience Programs — each containing data schemas that map program-specific data in feedback records to new tables — to increase the speed at which data can be processed.
Explore the Experience programs available for your instance and their schemas requesting the programs
and programRecordSchemas
nodes, respectively.
Example: Exploring Experience programs
query experiencePrograms {
programs(
first: 3
){
nodes {
name
id
createdBy
createdOn
description
status
responsesCount
__typename
}
}
}
Sample response
{
"data": {
"programs": {
"nodes": [
{
"name": "Contact Center transactional agent interaction",
"id": "6688cde1-3d7f-4486-b9ec-076c73d51364",
"createdBy": "_medallia_system_test",
"createdOn": "2021-07-23 04:57:02",
"description": "Program: Contact Center transactional agent interaction. Created by Merlin Spell",
"status": "ACTIVE",
"responsesCount": 0,
"__typename": "Program"
},
{
"name": "Retail Store e-receipt",
"id": "9a3317f9-dc77-4430-bced-b35d976d1d31",
"createdBy": "_medallia_system_test",
"createdOn": "2021-07-23 04:56:07",
"description": "Program: Retail Store e-receipt. Created by Merlin Spell",
"status": "ACTIVE",
"responsesCount": 0,
"__typename": "Program"
},
{
"name": "Wealth Management Client Onboarding",
"id": "abbb51a8-7792-4c41-b731-c873b492dd72",
"createdBy": "_medallia_system_test",
"createdOn": "2021-07-23 04:56:56",
"description": "Program: Wealth Management Client Onboarding. Created by Merlin Spell",
"status": "ACTIVE",
"responsesCount": 0,
"__typename": "Program"
}
]
}
},
"errors": null,
"_links": null,
"_allowed": [
"POST",
"GET"
]
}
Example: Exploring Experience program schemas
query recordSchemas {
programRecordSchemas(
first:3
){
nodes {
name
id
attributes {
nodes {
key
name
type
containsPii
}
}
}
}
}
Sample response
{
"data": {
"programRecordSchemas": {
"nodes": [
{
"name": "B2B Onboarding program",
"id": "ea891440-f715-43dd-a275-44cbd353dae9",
"attributes": {
"nodes": [
{
"key": "q_bp_b2b_ltr_scale",
"name": "Likelihood to Recommend",
"type": "ENUM",
"containsPii": false
},
{
"key": "timestamp",
"name": "Creationdate",
"type": "DATETIME",
"containsPii": false
}
]
}
},
{
"name": "B2B Onsite Service program",
"id": "cdf759c8-3bef-4c13-afca-159fb8bcc750",
"attributes": {
"nodes": [
{
"key": "q_bp_svc_ltr_scale",
"name": "Likelihood to Recommend Service",
"type": "ENUM",
"containsPii": false
},
{
"key": "timestamp",
"name": "Creationdate",
"type": "DATETIME",
"containsPii": false
}
]
}
},
{
"name": "B2B Project program",
"id": "3d69e34d-1eb6-458a-a726-53826937eab5",
"attributes": {
"nodes": [
{
"key": "q_bp_proj_ltr_scale",
"name": "Likelihood to Recommend Project",
"type": "ENUM",
"containsPii": false
},
{
"key": "timestamp",
"name": "Creationdate",
"type": "DATETIME",
"containsPii": false
}
]
}
}
]
}
},
"errors": null,
"_links": null,
"_allowed": [
"POST",
"GET"
]
}
Filters and pagination for schemas
Use a filter like the one shown below to get all fields for a specific program. By defining the parameter first
on the internal attributes
node — and not on the programRecordSchemas
— you get the data of all fields.
query experienceProgramSchema {
programRecordSchemas(
ids: "51c1a508-cf61-4be7-901c-87f3989ab7e1"
) {
nodes {
name
id
attributes(
first: 300
after: null,
) {
nodes {
key
name
type
containsPii
}
pageInfo {
endCursor
hasNextPage
}
totalCount
}
}
}
}
The endCursor
returned in the previous response should be added as part of the pagination of the attributes in the next query. For example, if the response contains the following pagination information:
[...]
"pageInfo": {
"hasNextPage": true,
"endCursor": "xWSJSCIGh9+8WBydu4cOW5xdK9Q"
}
[...]
The programRecordSchemas
query to get the next set of data looks like this:
query experienceProgramSchema {
programRecordSchemas(
ids: "51c1a508-cf61-4be7-901c-87f3989ab7e1"
) {
nodes {
name
id
attributes(
first: 300
after: "xWSJSCIGh9+8WBydu4cOW5xdK9Q",
) {
nodes {
key
name
type
containsPii
}
pageInfo {
endCursor
hasNextPage
}
totalCount
}
}
}
}
The query below is used to get the first 50 Experience programs and the first 50 fields for each program.
query getProgramSchemas {
programRecordSchemas(
first: 50
after: null
) {
totalCount
nodes {
id
name
attributes(first: 50, after: null) {
totalCount
pageInfo {
endCursor
hasNextPage
}
nodes {
containsPii
key
name
type
}
}
}
}
}
The next query below has additional pagination elements, it fetches the first 50 Experience programs and the first 100 fields for each program.
query getProgramSchemas {
programRecordSchemas(
first: 50
after: null
) {
totalCount
pageInfo {
endCursor
hasNextPage
}
nodes {
id
name
attributes(first: 100, after: null) {
totalCount
pageInfo {
endCursor
hasNextPage
}
nodes {
key
name
type
}
}
}
}
}