Unable to get reference CSV file for JS Tests

I am using a REST API with a POST request. I have created a CSV file to load in various inputs and using the Collection Runner to submit my requests and run the associated JS Tests iteratively. I am trying to figure out how I can also have an entry in each row of the CSV to reference for my JS Test in order to make the JS dynamic. Iā€™ve searched the POSTMAN documentation and forums, as well as Google and Stackoverflow, but havenā€™t found anything that works. Here is a basic example of what Iā€™m trying to accomplish.

Letā€™s say I have a basic adding API. Here is my Request:
{
ā€œNumbersā€: {
ā€œValue_1ā€: {{val1}},
ā€œValue_2ā€: {{val2}},
}
}

The CSV file is as follows.
val1,val2,sum
1,1,2
2,2,4
3,3,6

For this example, lets assume that the API returns a response that includes the sum of val1 and val2; something like this:
{
ā€œNumbersā€: {{sum}},
}

I am able to load val1 and val2 into my request and iterate through the request for each row, but I am having trouble incorporating the sum values (from the same CSV) into the JS Test.

I am trying to do something like the test below where I can reference the sum value from my spreadsheet, but Postman doesnā€™t like my syntax.

pm.test(ā€œAdding machineā€, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.Numbers === {{sum}});
});

Does anyone have any suggestions? Is this even possible to do?

@Kamoshin You cannot use {{variable_name}} syntax in the pre-request / test scripts.

Refer the following:

Youā€™ve to use pm.variables / pm.globals / pm.environment api according to where youā€™re storing the value of the variable to get the value of the variable in the test script.

If youā€™re taking the value of ā€˜sumā€™ from CSV file then youā€™ve to use the following syntax:

let sum = data.sum;

or you can also use the following syntax

let sum =  pm.iterationData.get('sum');

Refer the docs here.

Then you can use sum in your test.