Dynamic values in body #1476
-
I want to set dynamic values to json body. But I also want to keep the rest of body from manual input. How to achieve it? {
...
"created_at": Date.now(),
"id": crypto.randomUUID(),
"text": btoa(Math.random())
} I tried bru.setVar, but it says variable is not defined. And when manually defining its value, it is not overwritten by script. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I'm totally new to Bruno and can't figure out how to do this. It's a very useful feature, and Talend API Tester allows multiple expressions (albeit limited) to generate random data. |
Beta Was this translation helpful? Give feedback.
-
Over a year, but for those still wondering, there are dynamic variables similar to how Postman does it -- https://docs.usebruno.com/testing/script/dynamic-variables So in your response JSON in Bruno you can do something like: {
"name": "{{$randomFullName}}"
} |
Beta Was this translation helpful? Give feedback.
Over a year, but for those still wondering, there are dynamic variables similar to how Postman does it -- https://docs.usebruno.com/testing/script/dynamic-variables
So in your response JSON in Bruno you can do something like: