AutoBE
    Preparing search index...

    Array map expression for transforming elements into new values.

    Transforms each array element using a function, producing a new array with the transformed values. Essential for data transformation, extraction of specific properties, and converting between data formats in business scenarios.

    E2E testing scenarios:

    • Extracting IDs from captured entity arrays for subsequent API operations
    • Transforming product data for different API request formats
    • Converting user objects to summary data for business validations
    • Creating parameter arrays from captured business entities

    Primary usage: Data transformation when you need to convert captured API response data into formats suitable for subsequent operations or when extracting specific information from business entities.

    AI function calling strategy: Use when business logic requires transforming collections of captured data into different formats, especially for preparing data for subsequent API operations.

    interface IArrayMapExpression {
        array: IExpression;
        function: IArrowFunction;
        type: "arrayMapExpression";
    }
    Index

    Properties

    Properties

    Array expression to be transformed.

    Must be an expression that evaluates to an array containing business entities or data that needs transformation. Often references collections captured from API operations that require conversion to different formats.

    Each element in the array will be passed to the transformation function to produce a corresponding element in the resulting array. The original array remains unchanged.

    Examples:

    • Array of product entities requiring ID extraction
    • Collection of users needing transformation to summary format
    • Business data requiring format conversion for API parameters
    • Entity arrays from API responses needing property extraction

    Business context: Represents source data that needs to be converted to a different format or structure, such as extracting specific fields, calculating derived values, or preparing data for subsequent API operations.

    function: IArrowFunction

    Arrow function defining the transformation logic.

    Called for each array element to produce the transformed value. Should return an expression that represents the desired transformation of the input element, creating business-appropriate output data.

    The function parameter represents the current array element being transformed and can be used to access properties and create the transformed result.

    type: "arrayMapExpression"

    Type discriminator.