Passing variables from Pre-Process to Post-Process scripts

Hello, I’m new to DreamFactory but I’m starting to get the hang of it. I’m on Bitnami 2.14.1-13.

I’m playing with Scripts. Managed to get Pre-Process and Post-Process scripts working by following the examples in various places.

Now I’m thinking to pass a few variables created during the Pre-Process event, and have them available during the Post-Process event.

I tried to place a variable in

$event[‘request’][‘payload’][‘var1’] = ‘abc’;

during Pre-Process, but it is no longer there in Post-Process.

Edit: after further reading I realise payload is not the right place to hold variables.

How should I approach this please?

Thanks alot!

1 Like