DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Formula functions can be used in the value field of a custom header of a named credential or external credential.
A Binary Large OBject (BLOB) is a collection of binary data stored as a single entity. For named credentials, BLOBs can store binary executable code used in custom header formulas.
| Function | Description |
|---|---|
| BASE64DECODE(expr) |
|
| BASE64ENCODE(expr) |
|
| BLOB(expr) |
|
| HASH(algorithm, expr) |
|
| HEX(expr) |
|
| HMAC(algorithm, valueToSign, secretSigningKey) |
|
BLOB function first converts a string of form username:password into a binary. BASE64ENCODE then converts the binary into an encoded string. myExternalCredential is the name of an external credential.1BASE64ENCODE(BLOB($Credential.myExternalCredential.Username & ':' & $Credential.myExternalCredential.Password))X-Username with a base-16, SHA-256-hashed username as the value. req is an HTTPRequest. Username is an authentication parameter attached to a permission set mapping.1req.setHeader('X-Username', '{!HEX(HASH(\'SHA-256\', BLOB($Credential.myExternalCredential.Username)))}');BLOB isn’t required here because $Credential.myExternalCredential.Body is returned as a BLOB type, rather than as a String.1req.setHeader('X-Body', '{!HEX(HASH(\'SHA-256\', $Credential.myExternalCredential.Body))}');