Scripted response in mock server

Hello experts.

I’m new to mock servers in postman but couldn’t find the answer so please help me out here.

I have the following scenario;
An external API call will be done towards my mock server (this is already working)
The external API software expects that a provided header value (from the Reques) is sent back as raw text (in the response body).

Image from the mock server including what is expected:

Text from the external API Call software:

Is there a way to script something like this into the response created by t he mock server?
If so can you please point me to the right directen?

Thanks a lot for your help,
Regards Lukas

Postman mock servers are not that advanced (and they probably should not be).

The purpose of a mock is to provide some data, but not business functionality. For example, you can hardcode some verification value but you can’t read the request and dynamically change the response.