NetSuite Blog - August 5, 2023 - NetSuite SuiteScript Update Using Google Bard
As a NetSuite Administrator, I've been intrigued by the recent hype surrounding AI and how it could be used to improve my work. This week, I had the opportunity to put AI to the test when I was asked to round the result of a transaction body field that had been calculated using SuiteScript.
The script had been written by a developer a few months ago, but I didn't want to pay hundreds of dollars to update it for such a simple purpose. I had never written any JavaScript before, so I did some research on how to round numbers using the Math.round() and .toFixed() methods. However, I found it difficult to apply these methods in the correct syntax to get the expected result.
That's when I tried Google Bard. Bard was able to quickly and easily help me update the JavaScript code to round the number to the desired precision.
The first result was incorrect, and I wasn't sure what to do next. I was new to working with AI, and I didn't know if I had done something wrong or if Bard had made a mistake. I decided to be honest with Bard and tell it that the result was incorrect.
Bard apologized for the mistake and said that it would try again. It quickly generated a new result and after 3 tries my updated Javascript worked. I was impressed with Bard's ability to learn from its mistakes and to quickly provide an alternate result.
I also found that if you put your JavaScript code into Bard without any instruction, it will return a very well-formed description of the script. This was very helpful for me as a beginner, because it helped me to understand the code. I was able to see the different parts of the function and how they worked together.
If you are a NetSuite Administrator and have had any experiences with AI that have helped you in your work, I would love to hear from you! Please reach out to me and share your story. I am interested to find new ways to use AI in my work, and I would be grateful for your insights.
You can learn more about Bard here.
Note: I tried this using ChatGPT and got nearly identical results. As a Google Workspace Admin and User, I tend to use Google products myself.