@juni dev Thank you for reaching out to Microsoft Q&A. Using liquid
template, you can access request, response information along with context object. But you cannot evaluate policy expression like above. Alternatively, you can set policy expression value in variable, and then you can access it like below:
<set-variable name="UpdatedDateTime" value="@(System.DateTime.UtcNow.ToString())" />
<set-body template="liquid">
"UpdatedBy": "{{context.Request.Headers["ocp-apim-subscription-key"]}}",
"UpdatedDateTime": "{{context.Variables["UpdatedDateTime"]}}"
{%if body.displayName %} ,"displayName":"{{body.displayName}}" {% endif %}
</set-body>
Feel free to add a comment if you have any other questions. We would be happy to assist you. Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community.