We do not know your exact requirements which are forcing you to create a completely dynamic response. Before starting to discuss some solution, a word of warning. Be careful that you don't fall into the trap of making the virtual service too complex:
- if this virtual service needs to support a fixed, known set of test cases then the need for complete dynamic responses might point to the fact that the testcases are not optimized, that there is too much overtesting resulting in too many calls to your virtual service whereby each response might be different but adds little value to the testing of the SUT functionality.
- if this virtual service is used for exploratory testing, it would appear that the back-end system you are virtualizing has a very important function in the complete end-to-end flow. So don't end up almost rewriting the complete back-end functionality, it'll be a maintenance headache. There will be a trade-off between maintaining a complex custom virtual service or providing an actual live endpoint (from one of your test environments). At some point the latter might become less effort.
Apologies for making the word of warning longer than the actual response.
You can just replace the whole response with one property, e.g. {{prpCustomResponse}}, and then you can put whatever sequence of steps, or loops, or branches between the Listen step and the Responder step as long as you make sure that by the time the flow reaches the Responder step the property {{prpCustomResponse}} contains the payload you want to send back.
Cheers,
Danny