Action that transforms JSON data using JSONPath or JMESPath expressions Enables powerful querying and transformation of JSON structures

Example

// Extract values using JSONPath
await runAction({
ActionName: 'JSON Transform',
Params: [{
Name: 'InputData',
Value: { users: [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }] }
}, {
Name: 'Expression',
Value: '$.users[?(@.age > 26)].name'
}]
});

// Transform using JMESPath
await runAction({
ActionName: 'JSON Transform',
Params: [{
Name: 'InputData',
Value: { items: [{ price: 10, qty: 2 }, { price: 20, qty: 1 }] }
}, {
Name: 'Expression',
Value: 'items[].{total: price * qty}'
}, {
Name: 'TransformType',
Value: 'JMESPath'
}]
});

Hierarchy (view full)

Constructors

Methods

Constructors

Methods

  • Transforms JSON data using JSONPath or JMESPath expressions

    Parameters

    • params: RunActionParams<any>

      The action parameters containing:

      • InputData: JSON object or array to transform
      • Expression: JSONPath or JMESPath query expression
      • TransformType: "JSONPath" | "JMESPath" (default: "JSONPath")
      • Multiple: Boolean - return all matches vs first match (JSONPath only, default: true)
      • Flatten: Boolean - flatten array results (default: false)
      • WrapScalar: Boolean - wrap scalar results in object (default: false)

    Returns Promise<ActionResultSimple>

    Transformed data based on the expression

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result