# How to insert messages into a Kafka topic via Lenses UI (getting "Cannot insert data" message)

**URL:** <https://ask.lenses.io/t/how-to-insert-messages-into-a-kafka-topic-via-lenses-ui-getting-cannot-insert-data-message/185>\
**Category:** Lenses\
**Created:** [February 7, 2024, 3:20pm UTC](https://ask.lenses.io/t/how-to-insert-messages-into-a-kafka-topic-via-lenses-ui-getting-cannot-insert-data-message/185 "2024-02-07T15:20:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsindatry](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dsindatry](https://ask.lenses.io/u/dsindatry)\
**Post date:** [February 7, 2024, 3:20pm UTC](https://ask.lenses.io/t/how-to-insert-messages-into-a-kafka-topic-via-lenses-ui-getting-cannot-insert-data-message/185/1 "2024-02-07T15:20:56Z")

</div>

Hello, Is it mandatory to have a schema for a topic when inserting some test messages into a topic from lenses ?

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/lenses1/original/1X/96e5abc767deffbe6fb7fc1daaabcd3516b87e29.png)

---

<div class="post-metadata">

**Author:** ![guillaume.ayme](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/guillaume.ayme/32/64_2.png) [@guillaume.ayme](https://ask.lenses.io/u/guillaume.ayme)\
**Post date:** [February 8, 2024, 1:58am UTC](https://ask.lenses.io/t/how-to-insert-messages-into-a-kafka-topic-via-lenses-ui-getting-cannot-insert-data-message/185/2 "2024-02-08T01:58:23Z")

</div>

One way to get around Lenses enforcing a schema is to use the SQL Studio to create a topic and then using INSERT SQL statements to insert data.

Eg. Create the topic with:

```auto
CREATE TABLE mytopic (_key string, name string, number string[])
FORMAT 
   (string, json)
PROPERTIES (partitions=1, compacted=false);

```

…and then insert events as JSON objects:

```auto
INSERT INTO mytopic (_key, name, number)
   VALUES
   ("user1","John Doe", ["555-1234","555-5678"])

```
