# String to Array for API request

**URL:** <https://community.n8n.io/t/string-to-array-for-api-request/148438>\
**Category:** Questions\
**Tags:** transform-array, rest-api, qdrant\
**Created:** [July 12, 2025, 7:59pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438 "2025-07-12T19:59:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Macku](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/robert_macku/32/83645_2.png) [@Robert\_Macku](https://community.n8n.io/u/Robert_Macku)\
**Post date:** [July 12, 2025, 7:59pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438/1 "2025-07-12T19:59:21Z")

</div>

Hi

I want to send API request to Qdrant for hybrid retrieval. To do this, I need to send proper array of vectors, but everytime I upload this {{ $json.data[0].embedding }}, even it is an Array in input, it changes to string in output - and it makes error. I can’t find way how to send my {{ $json.data[0].embedding }} like array values - proper format for this api request.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/9/2/92f1ddb2d22f8e12ded6ab3c560d322288615289.png)

## What is the error message (if any)?

Bad request - please check your parameters

400 - {“status”:{“error”:“Format error in JSON body: Expected some form of vector, id, or a type of query at line 1 column 13012”},“time”:0}

## Share the output returned by the last node

### expected output:

query = [-0.043787975, 0.03704786,-0.08570875, 0.009757226, …1

## Information on your n8n setup

- **n8n version:** 1.95.3
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):** main
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** docker
- **Operating system:** Windows

---

<div class="post-metadata">

**Author:** ![jabbson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jabbson/32/87328_2.png) [@jabbson](https://community.n8n.io/u/jabbson)\
**Post date:** [July 12, 2025, 8:32pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438/2 "2025-07-12T20:32:48Z")

</div>

Hey @Robert_Macku hope all is well, welcome to the community.  
Could you try to surround you `{{ $json.data[0].embedding }}` with square brackets instead of double quotes? API expects this to be an array of integers. Like so:

```auto
"query": [{{ $json.data[0].embedding }}]

```

---

<div class="post-metadata">

**Author:** ![Robert\_Macku](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/robert_macku/32/83645_2.png) [@Robert\_Macku](https://community.n8n.io/u/Robert_Macku)\
**Post date:** [July 12, 2025, 10:47pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438/3 "2025-07-12T22:47:31Z")

</div>

> [@jabbson](#):
>
> `[{{ $json.data[0].embedding }}]`

Hi, thank you 🙂

Unfortunately, it doesn’t work. It is still string. 😕 I think it must be some solution here, but I absolutely don’t know, I try lot of thinks, but nothink help..

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/0/8/081fdc0c0772085f245770bef636992ee6a125a0.png)

---

<div class="post-metadata">

**Author:** ![jabbson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jabbson/32/87328_2.png) [@jabbson](https://community.n8n.io/u/jabbson)\
**Post date:** [July 12, 2025, 10:52pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438/4 "2025-07-12T22:52:51Z")

</div>

Is it still showing the same error though?

> 400 - {“status”:{“error”:“Format error in JSON body: Expected some form of vector, id, or a type of query at line 1 column 13012”},“time”:0}

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 10, 2025, 10:53pm UTC](https://community.n8n.io/t/string-to-array-for-api-request/148438/5 "2025-10-10T22:53:15Z")

</div>

Closed on October 10, 2025, 10:53pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
