Member-only story
Using ChatGPT for Placeholder Data: Kickstart Your Projects with Google Apps Script 🚀

ChatGPT is pretty much a universal API: one endpoint to get any data.
ChatGPT has recently taken the world by storm. Unless you have been living under a rock, then you have certainly seen a variety of content on this topic. One of its greatest advantages is its ease of use, and it is perfectly usable in Google Apps Script. With that in mind, here is one use case that we can implement: generating fake data.
Fake data is useful for testing purposes. At times, real data is too sensitive, and sometimes you do not have access to real data before production, but you need to begin working with something. Here is where fake data comes in.
We used to have a great library for fake data called Faker.js; however, Marak, the author, became so frustrated that he could not monetize the solution that he pushed an update that broke everything, which led to him being blocked onGitHub and NPM. As a result, the library is no longer maintained. ChatGPT, however, is not going anywhere.
Take note that ChatGPT is a paid service. However, at this time, you receive a free credit of $18 for three months upon registering, which means that you will be able to follow this tutorial.
As usual, the full source code can be found at this GitHub repository.
Create an Account and Login into Open AI
Open AI is the company behind ChatGPT. Just go to their website and create an account to access the chat.
Defining and Fine-Tuning the Prompt
The first thing to do is decide what exactly we want as a result. Let’s say we want to generate data for a spreadsheet that contains the following columns:
- id
- name
- age
- profession
- company
- address
Let’s try this prompt:
Generate 2 lines of the following fake data: id, name, age, email, profession, company, address