# Pull file from NetSuite custom record to an FTP server, change a custom select field on that custom record after file has been pulled

**URL:** <https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275>\
**Category:** Integrator.io\
**Tags:** script, ftp, file-transfer, netsuite\
**Created:** [February 16, 2021, 4:33pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275 "2021-02-16T16:33:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianduffy](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brianduffy](https://connective.celigo.com/u/brianduffy)\
**Post date:** [February 16, 2021, 4:33pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/1 "2021-02-16T16:33:28Z")

</div>

I have a custom record for shipment requests to our 3PL, a script creates these records and they are in the status of 'Pending Upload' and there is a custom field that holds the link to the file, I want to create a flow that searches for the custom records that have a status of 'Pending Upload' export the file to an FTP server and change the status on the custom record.

Does anyone know if the above is possible?

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [February 17, 2021, 5:37pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/2 "2021-02-17T17:37:31Z")

</div>

Hi, @brianduffy.

I encourage readers with more practical experience to jump in with any advice about possible efficiencies or pitfalls.

From your brief description, it sounds exactly like the kind of tasks you want an integration platform to accomplish, and all of the steps should be supported by integrator.io. At a high level, we could sketch a single flow:

- Export records from NetSuite – all orders with that field matching, or filter a later subset
- Import records to FTP – write the file to your server
- Import records to NetSuite – use static field mapping to change the value of the custom record in each order

Perhaps this method isn't obvious from your question: "Pull file from NetSuite." integrator.io doesn't need to work with a file/blob in this procedure.

And it could arguably be clearer in our documentation that "import records to FTP" actually means in most cases, "upload the resulting JSON records as a text file to an FTP server."

(p.s., You're not from the Columbus, OH, area, are you?)

---

<div class="post-metadata">

**Author:** ![brianduffy](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brianduffy](https://connective.celigo.com/u/brianduffy)\
**Post date:** [February 17, 2021, 6:16pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/3 "2021-02-17T18:16:32Z")

</div>

Hi Stephen,

Thank you for your help, I have an export from NetSuite, looking up the custom record type, using a saved search to identify the records that are 'Pending Upload', when I preview data I get:

{  
"page\_of\_records": [  
{  
"record": {  
"id": "101",  
"recordType": "customrecord\_cdp\_docxfer",  
"ID": "101",  
"Shipment Request XML": "565213-1", \<-- _This is a link to an XML file in the file cabinet, I simply whish to copy that file to the FTP server_  
"Status": "Pending Upload",  
"Shipment Request Doc": "565213-1",  
"Integration Response": "",  
"dataURI": ''  
}  
}  
]  
}

When I add FTP under Destinations it is added as a transfer and then I get errors that no import is selected, very confusing.

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [February 17, 2021, 9:28pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/4 "2021-02-17T21:28:14Z")

</div>

@brianduffy. Sorry, I confused the _file link_ and record mentioned with the actual _XML files_ in the NetSuite file cabinet. The flow proposed above would not be useful for transferring _existing_ files.

An in-house expert pointed me to a more Granular working example of what you're asking for:

1. Export Pending Upload orders based on a NetSuite Saved Search, including the file ids
2. NetSuite import – with a file download to retrieve the files from step 1
3. FTP import – to upload these files
4. Import records to NetSuite – use static field mapping to change the value of the custom record in each order

---

<div class="post-metadata">

**Author:** ![brianduffy](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brianduffy](https://connective.celigo.com/u/brianduffy)\
**Post date:** [February 23, 2021, 3:48pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/5 "2021-02-23T15:48:05Z")

</div>

Hi Stephen, this has been very helpful so far, thank you, I'm running into the error:

_ **Mismatch in the length of the data and the files array** _

on step 2, I am getting records that look like this:

{  
"record": {  
"id": "101",  
"recordType": "customrecord\_cdp\_docxfer",  
"ID": "101",  
"Shipment Request XML": "565213-1",  
"Status": "Pending Upload",  
"Shipment Request Doc": "565213-1",  
"Integration Response": "",  
"dataURI": [redacted]  
},  
"settings": {  
"integration": {},  
"flow": {},  
"connection": {},  
"import": {}  
}

and my file.name handlebar is

{{#each record}}{{record.[Shipment Request XML]}}{{/each}}

(I am not from the Columbus, OH area)

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [February 23, 2021, 4:05pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/6 "2021-02-23T16:05:56Z")

</div>

Hi, @brianduffy. Glad to hear it (minus the inevitable troubleshooting).

If I can reconstruct the flow correctly in this format, your records started off with Pending Upload orders, which presumably means that they each one _should_ have files attached. Is it possible that that's not how everything works in practice in NetSuite?

Would it help to filter out records without a "Shipment Request XML" before the import? Or add a conditional #if or #compare to the #each loop that adds the filenames?

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
RE: other Brian Duffy. It would have been too big of a coincidence, but now I'll always think of all BDs as sharp, patient engineers. :)

---

<div class="post-metadata">

**Author:** ![brianduffy](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brianduffy](https://connective.celigo.com/u/brianduffy)\
**Post date:** [February 24, 2021, 5:36pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/7 "2021-02-24T17:36:08Z")

</div>

Hi Stephen, once again thank you for your help. Every record has a link to the file, I think one of my issues was that the search results were only displaying the name of the file without a way to get the internal id. I added a column to the search that returns the internal id of the file, then in the 'Destinations & Lookups' I'm doing NetSuite - Lookup files, to get the internal id of the file and then destination of FTP. I successfully retrieve the records but then get an error, I believe, on the FTP import:

code: pre\_import\_validation\_failed

message: [{"message":"required sub schema, imp.file.xml is missing.","source":"connector","code":"missing\_required\_field","resolved":false,"occurredAt":1614187474625}]

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [February 24, 2021, 10:56pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/8 "2021-02-24T22:56:38Z")

</div>

@brianduffy,

You've encountered the "rare" undocumented error. I'm looking further into it, tracing similar resolutions of "pre\_import\_validation\_failed" in our support logs, and making inquiries at Celigo.

I'll try to post a follow-up status within a day or two. (To set your expectations, it's a _very_ uncommon error message. The answer most likely will be to recreate the flow or to submit a support ticket so that we can troubleshoot the flow as a whole.)

---

<div class="post-metadata">

**Author:** ![brianduffy](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brianduffy](https://connective.celigo.com/u/brianduffy)\
**Post date:** [February 25, 2021, 4:45pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/9 "2021-02-25T16:45:23Z")

</div>

Hi Stephen,

Thank you, please let me know what you find and if I should open a ticket

Brian

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [February 25, 2021, 5:39pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/10 "2021-02-25T17:39:21Z")

</div>

Hey, @brianduffy. A pattern hasn't emerged in the few cases I was able to find. I'll keep this thread updated if anything turns up.

I had hoped to be be able to offer you something in this forum, but your best and quickest track for troubleshooting would be through customer support.

---

<div class="post-metadata">

**Author:** ![aleksfrolovs](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@aleksfrolovs](https://connective.celigo.com/u/aleksfrolovs)\
**Post date:** [May 19, 2023, 1:55pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/11 "2023-05-19T13:55:07Z")

</div>

@stephenbrandt I'm having the same issue. The Customer Support is puzzled.

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [May 19, 2023, 4:58pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/12 "2023-05-19T16:58:00Z")

</div>

Hi, @aleksfrolovs. I'm following your ticket and Support's attempt to reproduce the error without being able to look at your customer's integration. In the best case, you'll have a quick resolution during your scheduled meeting.

I'll try to keep this thread updated with possible causes and troubleshooting tips for this error, and other Community members are welcome to contribute, as well.

In the previous post, the problem was solved by correcting the case of the lookup response field in the [response mapping](https://docs.celigo.com/hc/en-us/articles/360044279692-Response-mapping-results-mapping-and-advanced-lookups-example-for-NetSuite): from data[0].blob **k** ey to data[0].blob **K** ey.

---

<div class="post-metadata">

**Author:** ![aleksfrolovs](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@aleksfrolovs](https://connective.celigo.com/u/aleksfrolovs)\
**Post date:** [May 23, 2023, 11:48am UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/13 "2023-05-23T11:48:25Z")

</div>

@stephenbrandt thank you for coming back to me.

I have following in lookup response mapping..

 ![5301043caa20740200000001-a59a9ed5e4fc4a4da5bb8eacc824e195.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/8/8cb609887bdc64324c0f51b3b68d4be5e3bbcb19.png)

---

<div class="post-metadata">

**Author:** ![arturoduranmoreno](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@arturoduranmoreno](https://connective.celigo.com/u/arturoduranmoreno)\
**Post date:** [August 10, 2023, 5:25am UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/14 "2023-08-10T05:25:11Z")

</div>

Hi @stephenbrandt

Is there any update about this error? I'm having the same message error and I already reviewed my response mapping.

Best Regards

---

<div class="post-metadata">

**Author:** ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)\
**Post date:** [August 10, 2023, 9:55pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/15 "2023-08-10T21:55:57Z")

</div>

@arturoduranmoreno, I definitely recommend submitting your question to [support](https://docs.celigo.com/hc/en-us/articles/4407535381147-Submit-a-support-ticket).

There wasn't a pattern that I could discern, looking through the support queue for tickets related to the posts above.

---

<div class="post-metadata">

**Author:** ![arturoduranmoreno](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@arturoduranmoreno](https://connective.celigo.com/u/arturoduranmoreno)\
**Post date:** [August 10, 2023, 10:32pm UTC](https://connective.celigo.com/t/pull-file-from-netsuite-custom-record-to-an-ftp-server-change-a-custom-select-field-on-that-custom-record-after-file-has-been-pulled/1275/16 "2023-08-10T22:32:44Z")

</div>

Thanks @stephenbrandt, I already submitted a ticket.

Thanks a lot
