Pass multiple inputs from an array using Prescript

Hi, I want to pass multiple inputs using an Array to the request body and get the response. Can someone please help me on this?


        "mfid": "{{mfid}}",
        "secType": "OE"

Pre-request Script:

let mfidValues = pm.collectionVariables.get('mfidValues')

if(!mfidValues || mfidValues == 0) {
    mfidValues = ['22052', '22054'];

let currentMfId = mfidValues.shift();
pm.collectionVariables.set("mfid", currentMfId);
pm.collectionVariables.set("mfidValues", mfidValues);


var jsonData = pm.response.json();
var mfidValues = pm.collectionVariables.get('mfidValues');

    if (mfidValues && mfidValues.length > 0) {
    else {

As of now it is working now for one field i.e. β€œmfid”. Is there any way I can pass the inputs for multiple fields in the body using the same array i.e. to secType as well like below.

mfidValues1 = ['22052', 'OE'];
mfidValues2 = ['3668', 'CE'];

Hey @supply-geologist-495 :wave:

Is there anything you can get from this topic and the thread?

It seems like the same code being used. There are other similar questions in the community with the same code too.

or maybe this other topic:

Thanks Danny. I got the solution by referring to Allen Helton code :+1: