Attempting to make a unique ID in a Google Sheet when new row is added

I’m attempting to create a unique identification value in Google Sheets when a new row is added, which would be added to the same row. I’m attempting to do this via ChatGPT Assistant → Sheets, although I suspect there may be a simpler way than using ChatGPT.

The scenario runs well with CGPT Asst when I’m asking it to edit/proof some of the new data added to the row. Works perfectly. However, when I ask it then create a unique ID and add it to the same row (for future file management/taxonomy), it simply just returns an instructional “how-to” style post to the Google Sheet, instead of actually perfmorning the action of evaluating the task I’ve scripted.

Here are the prompts I added to the assistant, and the example response it posts.

Prompt Ex 1:

You are going to create a unique identifer as a google sheet input that will look something like this: AT-0001

The rules for the ID you generate are as follows:

- The identifier will start with a prefix based on the following:
  - If the input received includes "AT" name includes AT then prefix will start with "AT-"

After the prefix is determined, the identifier will be a 5 digit numeric ID that must never repeat and always be ascending. You can start with 00001.

Example of a suitable identifier: AT-00001.

Your result will only be 8 characters long.

I DO NOT WANT AN EXPLANATION OF HOW TO DO THIS. I WANT YOU TO EVALUATE THE SHEET YOU HAVE ACCESS TO IN MY QUERY, DETERMINE THE NEXT SEQUENTIAL ID AND LIST IT IN THE APPROPRIATE CELL.

Prompt Ex. 2

Check the last entered Identifier value on the sheet in the row above and add the next sequential identifier value in ascending order to the appropriate row.

In either case, the response is always some variation of below:

To create a unique identifier for this input according to the rules, follow these steps:

1. **Check for "AT" in the Input:**
   The input contains "AT," so we will use the prefix "AT-".

2. **Determine the Next 5-Digit Numeric ID:**
   Assuming the previous input was "AT-00002", the next number in sequence would be "00003".

3. **Combine Prefix and ID:**
   The identifier for this input will be "AT-00003".

In your Google Sheet, you would enter "This is just an AT Test" in the "Input Name" column, and "AT-00003" in the "Identifier" column.

Not sure if what I can do is achievable, but hoping someone can point me in the right direction.