A developer stores the user-selected product SKU in a context variable called $product_id and needs to include it in the JSON body of a webhook POST request. Which syntax correctly injects the variable value into the request body?
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 — <? $product_id ?> is your go-to move. watsonx Assistant uses SpEL (Spring Expression Language) for dynamic value substitution in webhook request bodies and response mappings. 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 SpEL (Spring Expression Language) for dynamic value substitution in webhook request bodies and response mappings. The correct syntax is <? $product_id ?>, which evaluates the expression at runtime and replaces it with the current value of the context variable. The other notations are not evaluated by the assistant's expression engine. The correct answer, "<? $product_id ?>", directly satisfies the scenario because it aligns with watsonx Assistant's design principles and the specific capability being tested. The incorrect options ("{{product_id}}", "$product_id", "context['product_id']") 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.