> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/conversion/toobject.md).

# toObject

## Description

Creates an object using the key-value pairs provided or creates a new object.

## Input / Parameter

| Name      | Description             | Input Type | Default | Options | Required |
| --------- | ----------------------- | ---------- | ------- | ------- | -------- |
| {Dynamic} | {Based on user inputs.} | Any        | -       | -       | No       |

Note: Dynamic input means that user can add the necessary input required as key-value pairs.

## Output

| Description                                  | Output Type |
| -------------------------------------------- | ----------- |
| Returns the new object with the passed data. | Object      |

## Example

In this example, we will create an object and print the result in the console.

### Step

1. Call the function `Conversion.toObject` inside the `Log.write` function.
2. Create the parameter(s) as required inside the `Conversion.toObject` and enter the value(s) for each parameter. In this example, we will create 2 parameters, 'name' and 'age' and enter the values {name: John, age: 27}.

   ![](/files/PiBprhmRnyHv1gtuEZbZ)

### Result

1. The console will print an object as depicted below.

   ![](/files/a3B4OItDjaSbOhbU4VKq)
