# FromBytes

| **Name**    | ***FromBytes***                                                                                                                                                                           |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | FromBytes (ByteArray bytes. String codePage)                                                                                                                                              |
| Purpose     | To return a string by reading a byte array in a specified encoding.                                                                                                                       |
| Description | Returns a string after it has been converted from a byte array.                                                                                                                           |
| Return Type | String                                                                                                                                                                                    |
| Parameters  | <p>bytes \[System.Byte\[]] – The raw byte array containing a textual value.</p><p>codepage \[System.String] – The code page the byte array is currently encoded in. Default is UTF-8.</p> |

![](/files/604gqylbAghcL4bBgmpg)

**Example**

In this example, we are passing the required parameters to the function transformation object using a *Variables* object and a *ToByte* object.

Where,

*bytes =* value

**Note:** The *Value* is the output value (bytes) from the *ToBytes* function transformation object, where a string value, “Hello World”, has been converted into a byte array.

*codepage* = 65001 (UTF-8 - Default)

![](/files/y3I02MXCJu9aOL73o7wQ)

Right-click on the *FromBytes* function transformation object and select *Preview Output.* You can see that Astera has returned a string value after successfully converting the provided byte array.

![](/files/M56Xci6EJNFAjDsBsxgA)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/functions/encoding/frombytes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
