Guides / n8n × Salesforce / Field mapping

Why a valid picklist value is rejected: Salesforce record type restrictions

A field's describe lists forty values while the record type you are writing to allows eight. Which endpoint answers the question that governs the write, and how to make mapping record-type-aware.

Illustrated troubleshooting diagram for Why a valid picklist value still gets rejected: Salesforce Record Type restrictions explained.
INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST on a value that the object describe lists as active and valid, and that works when the same record is edited by hand.
Short answer: A picklist's global value set and the subset available to a given record type are two different lists, and the record type's subset is what governs your write. The object describe returns the global set and will happily confirm a value that the target record type does not expose. The UI API picklist-values endpoint, called with the record type ID, returns the set that actually applies. If the object uses record types at all, build the mapping from that endpoint — 012000000000000AAA is the fixed ID of the Master record type.

Two lists, and describe shows the wrong one

Record types let an admin present different versions of the same object to different business processes, and one of the things they vary is which picklist values each process can use. An Opportunity StageName might carry forty values globally while the Renewals record type exposes eight of them and the New Business record type exposes twelve others.

The object describe returns the global set. Every value in it is real, active and correct in the sense that the field defines it — and a write of a value outside the target record type's subset is still rejected. That is why this failure is so disorienting: every check you run confirms the value is valid, because you are checking the wrong list.

The symptom that identifies it is a value that works for one record and fails for another on the same object and field. If a mapping passes for one record type and fails for another, the mapping is not record-type-aware yet — that is the entire diagnosis.

The endpoint that answers the question that matters

The UI API picklist-values resource takes an object, a record type ID and a field, and returns the values available for that combination. That is the set governing your write. The describe remains useful for building the initial mapping table and for reading the restrictedPicklist flag, but it cannot answer the record-type question.

# Global value set — every value the FIELD defines
GET /services/data/v66.0/sobjects/Opportunity/describe
Authorization: Bearer ACCESS_TOKEN
# -> fields[].name = "StageName"
#    fields[].restrictedPicklist = true
#    fields[].picklistValues = [ 40 entries, all "valid" ]

# What THIS RECORD TYPE allows — the set that governs the write
GET /services/data/v66.0/ui-api/object-info/Opportunity/picklist-values/012xx0000001AAA/StageName
# -> { "values": [ { "value": "Prospecting", "label": "Prospecting" },
#                  { "value": "Closed Won",  "label": "Closed Won" } ] }
#    8 entries, not 40.

# 012000000000000AAA is the fixed ID of the Master record type —
# use it when the object has record types but the integration
# writes against the default.

Know which record type you are writing to

A write that does not set RecordTypeId gets the default record type for the integration user's profile, which means the governing value set depends on a profile setting nobody thought about when the workflow was built. Two integration users with different profiles can produce different results from the same payload.

Set RecordTypeId explicitly on every write where the object uses record types. It removes the ambiguity, makes the mapping deterministic, and turns a configuration change on a profile into something that cannot silently alter the workflow's behaviour.

# Which record types exist on the object
GET /services/data/v66.0/sobjects/Opportunity/describe
# -> recordTypeInfos: [
#      { "name": "Master",       "recordTypeId": "012000000000000AAA",
#        "defaultRecordTypeMapping": false, "available": true },
#      { "name": "Renewals",     "recordTypeId": "012xx0000001AAA",
#        "defaultRecordTypeMapping": true,  "available": true } ]

POST /services/data/v66.0/sobjects/Opportunity
{ "Name": "Acme renewal",
  "RecordTypeId": "012xx0000001AAA",     # explicit, not inherited
  "StageName": "Prospecting",            # from THAT record type's set
  "CloseDate": "2026-10-31" }

Making the mapping record-type-aware

Keep one mapping table per record type rather than one for the object. Fetch the picklist values for each record type the workflow writes to, once, and cache them — picklist value sets change on the timescale of admin work, so fetching them per item spends API calls to learn something that did not move.

Route unmapped values to an error branch instead of sending them. A value that has no entry for the target record type is a business question — either the record type should expose it, or the source data should not be producing it — and neither answer is available inside the workflow at runtime.

Test one record per record type before going live. A test suite that covers only the default record type passes completely and tells you nothing about the others.

Do not un-restrict the picklist to make this go away. Unrestricted picklists accept anything, which breaks reports, validation rules and every downstream automation that assumes a clean value set — and it does not make the record type expose the value either.

The other restriction that behaves the same way

Record types are not the only thing that narrows a picklist at write time. A dependent picklist is filtered by the value of a controlling field, so the set of values available depends on what else is in the same record — and a value that is valid for one controlling value is rejected for another, with the same error and the same absence of explanation.

The symptom looks almost identical to the record-type case: a value that the describe confirms, that works for some records and not others. The distinguishing question is whether the records that succeed share a record type or share a controlling field value. Checking that one thing separates the two causes immediately.

The describe exposes the dependency — a dependent field names its controller, and the valid-for information encodes which controlling values permit which dependent ones. A mapping that is aware of both the record type and the controlling field is more work than one that ignores both, and it is the only version that survives contact with an org where admins use these features as intended.

Where a workflow writes both the controlling and the dependent field, send them together and validate the pair rather than each field independently. Validating them separately passes on both and fails on the combination.

Where these facts come from