Hello everyone, I’m currently working on an Airtab...
# suitescript
c
Hello everyone, I’m currently working on an Airtable integration between NetSuite (using SuiteScript 2.1) and Airtable. The goal is to update a specific field in Airtable whenever a record is changed in NetSuite. However, I’ve run into an issue — Airtable’s API uses the PATCH method to update a single field in a record, but NetSuite’s N/https module does not support PATCH requests (it only supports GET, POST, PUT, and DELETE)
n
Did you try not using the ENUM and passing in "patch" with https.request method?
c
@NickSuite thanks for respone. I have tried this but no luck.
Is there a way that we can use PATCH method in NS?
c
What a crappy problem. Can you try this HTTP header? (I doubt Airtable supports it but worth a try). https://suiteanswers.custhelp.com/app/answers/detail/a_id/37768/loc/en_US
👀 1
d
If you have access to AWS or another website, you can setup a simple proxy, that reads a custom header and switches it from POST to PATCH.
✔️ 1
c
What @Daryl K said is technically true but introducing a new system to the IT landscape can be very tricky at many companies.
d
Oh it's definitely not ideal, but other MITM solutions are overkill.
c
A small AWS lambda would be easy to create for this purpose. The harder part is getting approval, procurement, a PO, infra team agreeing to own it etc… the usual bureaucracy 🤷 (Depends on the org though).
c
Thanks @Craig! I tried with restlet with HTTP header but It's throwing an error 422 - Invalid Request
n
RESTlet is not what @Craig suggested.
c
@NickSuite He shared an article that explains how to use the RESTlet POST method with an HTTP override header to simulate a PATCH request. I tried implementing this approach, but unfortunately, it didn’t work as expected. Introducing AWS as a middleware solution could address the limitation, but it may be challenging for our client due to infrastructure and approval constraints. However, I can recommend it as a potential option if they are open to exploring it.
n
Instead of AWS, a PHP script can do the same. They can host it on their website server.
❤️ 1
c
Same technical principle, possibly the same bureaucracy too.
You could also do it on an apache server under your desk 😄
😂 2