> For the complete documentation index, see [llms.txt](https://glyue.docs.sandboxbanking.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glyue.docs.sandboxbanking.com/tutorials/building-a-single-step-integration/4.-crafting-the-output.md).

# 4. Crafting the Output

**Generate an Output**

In the previous step, we saw the response from `randomuser.me`. Now, we will extract and format data from that response, and display it in the output of the integration.

Return to the **Build page**, and open the service request of your integration by right-clicking it and selecting *Go To > Service Requests.*

Find the *After Execute Request Success Hook* (this may require scrolling to the right) and open the code editor by clicking on the expand icon in the cell. A code editor will appear on the bottom half of your screen.

In the code editor, enter the following Python code:

```python
first_name = request_users.response.payload.results[0].name.first
summary = f"The new user's name is {first_name}."
output.payload = summary
```

<figure><img src="https://688288018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1flQ2To8tQpCQWl2Ty9U%2Fuploads%2FQgfIXoZvDrO1LwJZu6nr%2FScreenshot%202024-09-03%20at%2012.17.01%E2%80%AFPM.png?alt=media&amp;token=c9a714eb-c5e2-4f24-a7ba-7d099ac5db8d" alt=""><figcaption><p>Code written in the <em>After Execute Request Success Hook</em></p></figcaption></figure>

Save your changes.

**Re-run the Integration**

Return to the **Run History** page using the navigation sidebar on the left.

In the entry list on the left, hover over the entry with the name of our integration. You will see the entry highlight, and a circular arrow icon appear on the right side. Click on the rerun icon, which will open the **Integration Runner.**

<figure><img src="https://688288018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1flQ2To8tQpCQWl2Ty9U%2Fuploads%2FzNqx2azpOcoIOtouxr2b%2FScreenshot%202024-09-03%20at%2012.17.30%E2%80%AFPM.png?alt=media&amp;token=a06abd37-3930-40f5-acf8-31b8d9c00054" alt=""><figcaption></figcaption></figure>

Leave all fields empty and click *Execute* on the bottom-left. A new entry will appear on the **Run History.**

Close the **Integration Runner** and open the new entry. Open the *Step* labeled `OUTPUT` and now see the message we wrote in the payload. It should read "The new user's name is \[name]".

<figure><img src="https://688288018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1flQ2To8tQpCQWl2Ty9U%2Fuploads%2FZjunP9gEiCRqa3pZbOkj%2FScreenshot%202024-09-03%20at%2012.18.04%E2%80%AFPM.png?alt=media&amp;token=bd3488d5-daa7-4c64-bd41-d9f278528b07" alt=""><figcaption><p>Updated Output message</p></figcaption></figure>

***

Congratulations! 🎉 You've finished building a simple integration that makes an API call to a third-party system, parses the response, and returns a message using the information in the response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://glyue.docs.sandboxbanking.com/tutorials/building-a-single-step-integration/4.-crafting-the-output.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
