I try to figure out how to add custom code to my request similar way to pre-request script in Postman like:
const items = JSON.parse(pm.collectionVariables.get('items'))
const randomItem = _.sample(items)
pm.variables.set('randomItemId', randomItem.id)
pm.variables.set('randomItem', JSON.stringify(randomItem));
I know that for 03 2023 importing external libraries is in beta, but let's assume it works ok.
I understand that I need to create filter
:
First question: where is option to create one? I wish it will be separated form my project code.
Second question: can I have filter code directly in my request (visible to quickly check what happening in request)? Or I need to create filters for every request where I need new custom code
I tried follow docs but there is no clear information where add files for filters: https://github.com/rangav/thunder-client-support/blob/master/docs/filters.md