{
  "slug": "filter-empty-salesforce-custom-fields",
  "title": "Salesforce contact json filter custom fields empty",
  "metaTitle": "Salesforce contact json filter - RealComposer",
  "metaDescription": "Salesforce contact json filter custom fields empty. Strip null custom properties like HubSpot slimming reci. Map only UI fields from Salesforce before.",
  "headline": "CRM cards without hundreds of null custom fields",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 8,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Salesforce"
  ],
  "searchIntentQuery": "salesforce contact json filter custom fields empty",
  "directAnswerSummary": "Strip null custom properties like HubSpot slimming recipe. For \"salesforce contact json filter custom fields empty\", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let Frontend / Web hit only https://realcomposer.com/v1/workspace/filter-empty-salesforce-custom-fields with an rc_live_ client token.",
  "problem": {
    "title": "Unmapped Salesforce fields waste bandwidth",
    "explanation": "Salesforce returns nested CRM, audit, and configuration objects. Frontend / Web parses them on the main thread even when the UI binds three fields.",
    "risks": [
      "Large arrays kept in memory after navigation",
      "Analytics showing poor LCP on API-heavy screens",
      "Developers shipping defensive null checks for unused paths"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Create SALESFORCE_ACCESS_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Point step salesforce at https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} with GET. Map only the UI fields in output mapping so clients never download audit or nested blobs. Leave cache TTL at 0 when each response is user-specific (include userId or record id in query params before enabling cache)."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/filter-empty-salesforce-custom-fields', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Salesforce contact json filter custom fields empty",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "salesforce",
        "upstreamUrlTemplate": "https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.SALESFORCE_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "contactId",
          "sourcePath": "Id",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "email",
          "sourcePath": "Email",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "name",
          "sourcePath": "Name",
          "type": "string",
          "sourceStep": "salesforce"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_filter-e",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "filter-empty-salesforce-custom-fields"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contactId": "sample",
    "email": "sample",
    "name": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/filter-empty-salesforce-custom-fields\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "What should Frontend / Web store instead of Salesforce secrets?",
      "answer": "Point Frontend / Web at /recipes/filter-empty-salesforce-custom-fields edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "filter-empty-salesforce-custom-fields vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Rotate vault secrets for filter-empty-salesforce-custom-fields anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "filter-empty-hubspot-properties",
    "strip-sensitive-fields-user-profile-api"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/filter-empty-salesforce-custom-fields",
    "markdown": "https://realcomposer.com/recipes/filter-empty-salesforce-custom-fields.md",
    "json": "https://realcomposer.com/recipes/filter-empty-salesforce-custom-fields.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=filter-empty-salesforce-custom-fields&via=agent"
  }
}