FluxyAPIFluxyAPI
BlocksOperations & Manipulation

Map JSON

Extract or reshape specific fields from a complex JSON object.

Map JSON Block

The Map JSON Block is used to extract a subset of properties from a large JSON object or array, effectively reshaping the data payload.

Configuration

FieldRequiredDescription
Input JSONThe original JSON object or array variable.
Mapping RulesA definition of which keys to extract and what their new keys should be.

Behavior

The block processes the Input JSON according to the rules, selecting only the requested fields and discarding the rest. This is highly useful for cleaning up API responses before sending them to the client or storing them in a database, ensuring no sensitive data is leaked.

Output Variable

Specify a Variable Name to hold the reshaped JSON object.

Success Payload

The output will be the extracted or mapped JSON object or array:

[
  "value1",
  "value2"
]

Errors & Responses

If an error occurs, the variable will be populated with:

{
  "error_key": "INVALID_INPUT",
  "error_message": "Input must be a valid JSON array."
}

Common Error Keys: INVALID_INPUT, RUNTIME_ERROR

On this page