# How to display the GPT answer in the form?

**URL:** <https://community.feathery.io/t/how-to-display-the-gpt-answer-in-the-form/1211>\
**Category:** Support\
**Created:** [December 23, 2024, 8:53am UTC](https://community.feathery.io/t/how-to-display-the-gpt-answer-in-the-form/1211 "2024-12-23T08:53:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanchezboy2](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@sanchezboy2](https://community.feathery.io/u/sanchezboy2)\
**Post date:** [December 23, 2024, 8:53am UTC](https://community.feathery.io/t/how-to-display-the-gpt-answer-in-the-form/1211/1 "2024-12-23T08:53:34Z")

</div>

Hello!

I want to generate an answer using ChatGPT based on the data I collected in the form (name, gender, age, etc.) and show it on the last step of the form. How can I do this?

1. I connected [OpenAI Integration | Feathery](https://www.feathery.io/integrations/openai)
2. I use step loading as a trigger
3. I use collected data in promt ({{gender}}, {{age}}…)
4. I try to save the answer in field{{GPT\_answer}} and display it on the next step, but it is not displayed.

Please tell me what I’m doing wrong? Where is the GPT response stored and how to display it?

Thank you in advance for your help.

Best regards!

---

<div class="post-metadata">

**Author:** ![Kenny](https://avatars.discourse-cdn.com/v4/letter/k/90db22/32.png) [@Kenny](https://community.feathery.io/u/Kenny)\
**Post date:** [December 23, 2024, 5:08pm UTC](https://community.feathery.io/t/how-to-display-the-gpt-answer-in-the-form/1211/2 "2024-12-23T17:08:36Z")

</div>

Hi Sanchez,

```
You can try following this example on making use of the OpenAI integration.

```

To integrate ChatGPT with your application, you can follow the steps and make adjustments to fit your need.

1. **Collect User Inputs** : Gather necessary information such as location, time, and event type from the user.

2. **API Connector Setup** :

- Create an API connector with the base URL `https://api.openai.com/v1`.

- Allow the endpoint `/chat/completions`.

- Set the headers with `Authorization: Bearer {{OPENAI_API_KEY}}`, replacing `{{OPENAI_API_KEY}}` with your actual OpenAI API key.

1. **API Request** : Use the following logic to send a POST request to the OpenAI API:

```auto
const location = AILocation.value;
const time = AITime.value;
const eventType = AIEventType.value;

const res = await feathery.http.POST('https://api.openai.com/v1/chat/completions', {
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "You are a friendly event planner. Maximum 50 word responses."
      },
      {
        "role": "user",
        "content": `Create an invitation message for an event. The location is ${location}. The time is ${time}. The event type is ${eventType}.`
      }
    ]
})

AIMessage.value = res.choices[0].message.content;

```

This setup will allow you to generate a customized invitation message using ChatGPT based on user inputs.
