How to automate the import of bank statement files...
# ask-stanley-ai
a
How to automate the import of bank statement files such as bai2 files? I'm asking because we already have sftp set up which is how we get the files in the first place, and we don't want to hassle with setting up connectors. We do want to be able to import the statements on a scheduled basis like you can with the connectors though. We would want to import these files either directly via the same sftp connection that pulls them to our on-premises folders, or pull them in from those folders themselves.
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can automate the import of bank statement files such as BAI2 files using SuiteScript. You can create a batch script that reads the file from the inbound folder, imports the bank data, and then moves the file to the archive folder. Here are the steps you can follow: 1. Create a SuiteScript that reads the BAI2 file from the inbound folder. You can use the
nlapiLoadFile
function to load the file from the file cabinet. 2. Parse the BAI2 file and create a JSON object or an array with the bank data. The structure of the BAI2 file is well-documented, so you should be able to parse it using JavaScript string functions. 3. Use the
nlapiSubmitRecord
function to create bank statement records in NetSuite. You will need to map the fields in your JSON object or array to the fields in the bank statement record. 4. After the bank data has been imported, move the BAI2 file to the archive folder using the
nlapiSubmitField
function. 5. Schedule the SuiteScript to run on a regular basis. You can use the
nlapiScheduleScript
function to schedule the script. Please note that this is a high-level overview of the process and you may need to adjust it based on your specific requirements and the structure of your BAI2 files. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842773438
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836181641
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8359375
Please provide your feedback on this answer.