How do I add a record and then edit in the same function stack?

Options
dmitriianikin
dmitriianikin Member
edited March 2023 in ? Working with APIs

Hi all!

I'm trying to:
1. Add a new record (based on a user's input)
2. Send a request to the ChatGPT API
3. Save the return value to the record that was saved in step #1

Is this the right way to go about it? If so, how do I do it?

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @dmitriianikin looks like you're thinking about it the right way! You'd want to make sure you are editing the record that is created in step 1 Add Record.

    However, in terms of potentially optimizing this flow. I'm wondering if you think about it by making your API call, and once you have all the information for the record, then doing an Add Record.

    So it would potentially look like:

    1. API call
    2. Add Record

    This way you are minimizing your requests to the database.