> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# fromString

APISummary
Input data in json and return the parsed `TemplateData` object.

## Syntax

### Android

```java
public static TemplateData fromString(String json);
```

#### Parameters

- `json`: `String` type data in json format.

#### Return

- `TemplateData` constructed by `json`.

### iOS

```objc
- (instancetype)initWithJson:(NSString *)json;
```

#### Parameters

- `json`: `NSString*` type data in json format.

#### Return

- `TemplateData` constructed by `json`.

### Desktop (C++)

Desktop public API constructs `LynxTemplateData` directly from the JSON string:

```cpp
auto data = std::make_shared<lynx::pub::LynxTemplateData>(json);
```

#### Parameters

- `json`: The JSON string used to create the template data.

## Compatibility

**Compatibility Table**

**Query:** `lynx-native-api.template-data.from-string`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/template-data/from-string.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| from-string | Yes (2.8) | No | Yes (2.8) | Yes (3.7) | Yes (3.7) | No |

**`from-string`**

Input data in json and return the parsed TemplateData object.

**Specifications:**

