A webhook call returns a JSON response with a nested object: {"customer": {"status": "active", "tier": "gold"}}. A developer wants to store the tier value in a context variable named $customer_tier. Which expression correctly retrieves this nested field from the webhook response in watsonx Assistant?
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 — <? $webhook_result_1.customer.tier ?> (spel expression language dot notation) is your go-to move. watsonx Assistant uses Spring Expression Language (SpEL) to access webhook response values. 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
watsonx Assistant uses Spring Expression Language (SpEL) to access webhook response values. The syntax <? $webhook_result_1.field.subfield ?> accesses nested fields using dot notation. The variable name $webhook_result_1 references the first webhook response; bare dot notation without SpEL delimiters and dollar-paren syntax are not valid in watsonx Assistant context variable expressions. The correct answer, "<? $webhook_result_1.customer.tier ?> (SpEL expression language dot notation)", directly satisfies the scenario because it aligns with watsonx Assistant's design principles and the specific capability being tested. The incorrect options ("The nested value cannot be mapped directly from a webhook; the API must return a flat JSON object", "$webhook_result_1.customer.tier (bare dot notation without SpEL delimiters)", "$(webhook_result_1.customer.tier) (dollar-paren function syntax)") 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.