How to use variables from the CSV file

Hi guys!
Could you please help me with a DataDriven tests.

My question: I have a CSV file with the CommunitiesID that I need to use like a variable for a graphQL query.

I added a pre-request scripts:

pm.environment.set("communitiesId", data.communitiesId);
let list =;
pm.environment.set("Total_Records", list);

And this is my CSV file:

And this is a console:

The response should look like this:

    "data": {
        "findOneCommunity": {
            "yglId": 1441860,
            "name": "Acuity Homecare LLC",
            "title": "Acuity Homecare LLC",
            "slug": "acuity-homecare-llc-1441860",
            "isApfm": true,
            "isCustomer": false,
            "batchDate": "2021-11-11T00:00:00.000Z",
            "amenities": []

Will appreciate your help