# Netsuite to Portatour - form-data file transfer

**URL:** <https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068>\
**Category:** Integrator.io\
**Tags:** netsuite\
**Created:** [February 16, 2026, 10:27am UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068 "2026-02-16T10:27:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Broadbent](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Anthony\_Broadbent](https://connective.celigo.com/u/Anthony_Broadbent)\
**Post date:** [February 16, 2026, 10:27am UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068/1 "2026-02-16T10:27:38Z")

</div>

I am trying to integrate Netsuite with Portatour. The idea is that I want to transfer Saved Search (JSON) data into Portatour which only accepts CSV data but with an ‘importconfig’ file which is a JSON structured mapping file that will map the CSV headers with the field names in Portatour.

I have set up a connection to Portatour in Postman but the structure is very odd. It uses HTTP Body form-data transfer of files, one each for the CSV data and one for the importconfig file. I have attached a screenshot of how this looks for clarity.

 ![portatpur-postman](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/0/0dfbe5a281be53f6ba9e15d4d865e3ea85ed22a0.png)

I have set up the flow and a postMap script on import to try and convert the NetSuite saved search data to a CSV blob but it doesnt seem to work right.  
I would like to know if this is possible with Celigo.

---

<div class="post-metadata">

**Author:** ![nuriensing](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/nuriensing/32/6918_2.png) [@nuriensing](https://connective.celigo.com/u/nuriensing)\
**Post date:** [February 17, 2026, 8:46am UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068/2 "2026-02-17T08:46:53Z")

</div>

Use **"Transfer files into destination application"** as the import type with your HTTP connection to Portatour.

- **HTTP method** : `POST`
- **Relative URI** : `/a/api/ImportCustomers?mode=UpdateOrInsert`

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/f/f9da9ef1a331f1001b030798375e4b984c53ae24.png)

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/1/1ad43711bc6b3dd14c74213142b59fb300676d33.png)

The request body needs two inline parts for the multipart form:

 ![image](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/4/445c2c6c3b7a89b23dbf1d7e9d05b5563abed8f9.png)

```auto
[
  {
    "name": "file",
    "value": "{{csvData}}",
    "type": "inline",
    "mime-headers": {
      "Content-Disposition": "form-data",
      "content-type": "text/csv",
      "filename": "customers.csv"
    }
  },
  {
    "name": "importConfig",
    "value": "{{importConfigJson}}",
    "type": "inline",
    "mime-headers": {
      "Content-Disposition": "form-data",
      "content-type": "application/json",
      "filename": "customers-template.importcfg"
    }
  }
]

```

A few things worth noting:

- `type: "inline"` means you're providing content directly as a string — works perfectly here since both the CSV and importConfig are text-based
- `type: "attachment"` with `"value": "{{blob}}"` is for when you have a blobKey from a prior blob export, which isn't needed here
- The docs mention only one **file reference** (blob type) per import, but since both parts are inline this shouldn't be an issue
- Don't include the boundary — Celigo adds it automatically
- Make sure to set the header `Content-Type: multipart/form-data`

[Reference: Celigo docs on multipart/form-data](https://docs.celigo.com/hc/en-us/articles/360052055191-Upload-a-file-or-record-as-multipart-form-data)

For generating the CSV from the NetSuite saved search data, I'm using a `preSavePage` hook on the export. One thing to keep in mind — `preSavePage` runs **per page** , not across all pages. So either set the export page size high enough to capture all customers in one go, or accept that each page becomes a separate CSV upload (which should be fine since Portatour's `UpdateOrInsert` mode is idempotent).

```auto
function preSavePage(options) {
  const records = options.data;
  if (!records || !records.length) {
    return {
      data: [],
      errors: options.errors,
      abort: false,
      newErrorsAndRetryData: []
    };
  }

  const columns = ['ExternalId', 'CompanyName', 'Street', 'ZipCode', 'City', 'Country'];

  let csv = columns.join(',') + '\n';
  for (const rec of records) {
    const row = columns.map(col => {
      let val = (rec[col] || '').toString().replace(/"/g, '""');
      return `"${val}"`;
    });
    csv += row.join(',') + '\n';
  }

  return {
    data: [{
      csvData: csv,
      importConfigJson: JSON.stringify({ /* your importcfg content */ })
    }],
    errors: options.errors,
    abort: false,
    newErrorsAndRetryData: []
  };
}

```

If the importConfig is always the same (just a field mapping template), you can hardcode it directly in the request body template instead of passing it dynamically.

Overall flow ends up being:

```auto
NetSuite Saved Search Export (JSON)
  → preSavePage hook (convert records to CSV string)
  → HTTP Transfer to Portatour (multipart/form-data, 2 inline parts)

```

---

<div class="post-metadata">

**Author:** ![Anthony\_Broadbent](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Anthony\_Broadbent](https://connective.celigo.com/u/Anthony_Broadbent)\
**Post date:** [February 17, 2026, 10:50am UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068/3 "2026-02-17T10:50:17Z")

</div>

Thanks for this response, it is very helpful. However I realise that I am required to have both files transferred from Netsuite as attachments. Using your instructiuons I have managed to do this with the CSV but since I can only put one blobKey in and I can only use {{blob}} once in the handlebars template, how can I reference two files?

---

<div class="post-metadata">

**Author:** ![nuriensing](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/nuriensing/32/6918_2.png) [@nuriensing](https://connective.celigo.com/u/nuriensing)\
**Post date:** [February 17, 2026, 11:06am UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068/4 "2026-02-17T11:06:17Z")

</div>

Maybe you can insert a json object in the importConfig? And only use the `{{blob}}` for the CSV:

```auto
[
  {
    "name": "file",
    "type": "attachment",
    "value": "{{blob}}",
    "mime-headers": {
      "Content-Disposition": "form-data",
      "content-type": "text/csv",
      "filename": "customers.csv"
    }
  },
  {
    "name": "importConfig",
    "type": "inline",
    "value": "{ ...your actual importcfg JSON content here... }",
    "mime-headers": {
      "Content-Disposition": "form-data",
      "content-type": "application/json",
      "filename": "customers-template.importcfg"
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![Anthony\_Broadbent](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Anthony\_Broadbent](https://connective.celigo.com/u/Anthony_Broadbent)\
**Post date:** [February 17, 2026, 12:52pm UTC](https://connective.celigo.com/t/netsuite-to-portatour-form-data-file-transfer/6068/5 "2026-02-17T12:52:10Z")

</div>

> [@nuriensing](#):
>
> ```auto
> "mime-headers": {
> "Content-Disposition": "form-data",
> "content-type": "text/csv",
> "filename": "customers.csv"
> }
> 
> ```

This worked perfectly. Thank you
