I have a somewhat unique situation. The API I’m testing takes {{ as part of the json body and uses it as a sort of macro.
I’d like to inject a variable into this macro, it looks like this without variables injected:
{
"key": "Some text: {{DATE(2020-10-10T00:00:00.000Z),long}} some more text"
}
I’d like to be able to replace that date string with a Postman variable:
{
"key": "Some text: {{DATE({{$TODAY}}),long}} some more text"
}
But it just sends the whole block of braces and doesn’t replace that date. Is there a way to escape the first curly braces or otherwise use a different technique to inject the variable?
So based on the snippets you have provided below, seems like the variable “TODAY” is a environment variable. If that’s the case the dollar is not required. We need to provide the $ for Dynamic variable like “$randomDateFuture”.
So if you have already defined the variable “TODAY” just access like below
{
"key": "Some text: {{DATE({{TODAY}}),long}} some more text"
}