A custom extension returns an array of up to 5 results. How can the developer surface the first item to the user?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Todd Lammle: 'Imagine you're building a chatbot and this exact situation comes up — map the first array element (index 0) to a session variable using the extension output mapping is your go-to move. The extension output mapping supports array index notation to extract a specific element; mapping array[0] to a session variable for use in the response step. This is a classic Domain 6: Build Back-End Integrations concept you'll want locked in before exam day.'
Full explanation below image
Full Explanation
The extension output mapping supports array index notation to extract a specific element; mapping array[0] to a session variable for use in the response step. There is no 'array' response type. Separate intents do not process API responses. Spell correction is for user input; not API response parsing. The correct answer, "Map the first array element (index 0) to a session variable using the extension output mapping", directly satisfies the scenario because it aligns with watsonx Assistant's design principles and the specific capability being tested. The incorrect options ("Set the response type to 'array' in the action step", "Create a separate intent to handle array responses", "Filter the response using spell correction to extract the first word") may appear relevant but each misses a key requirement or introduces a step that is either unnecessary or belongs to a different workflow. Mastering the distinction between these approaches is essential for effective watsonx Assistant implementations and is a core focus of the Domain 6: Build Back-End Integrations section of the certification exam.