# Passing all values of an array into a single x-www-form-urlencoded body

**URL:** <https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883>\
**Category:** Questions\
**Tags:** arrays, http\
**Created:** [August 14, 2024, 3:06am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883 "2024-08-14T03:06:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 14, 2024, 3:06am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/1 "2024-08-14T03:06:22Z")

</div>

Greetings! I have a scenario where by I am attempting to use the HTTP module to retrieve an array of **secondary\_group\_ids** via the http module. I then use the tools function to add to the array an additional secondary\_group\_id, which works sucessfully

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/f/3/f3c9666aba82bd17fdb840f5d1f5d5a1caee63c1.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/b/6b58bb064a9d1e20498353655d8b6db04ac15ee8.png)

I then need to use the HTTP module to post a x-www-form-urlencoded message with the body of the message containing a key value pair for each element of the modified\_secondary\_group\_ids, whereby the key is a static string “secondary\_group\_ids” and the value is the value of each element of the array. The body needs to contain all key, value pairs together when posting to the API. Similar to what is shown below

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/3/f/3fbb9c01d9cdf967af18d5194e1f7f76639603bb.png)

Really appreciate any advice that can be offered on how to properly format the http module to set the fields appropriately!

---

<div class="post-metadata">

**Author:** ![ImMichaelCannon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/immichaelcannon/32/48674_2.png) [@ImMichaelCannon](https://community.make.com/u/ImMichaelCannon)\
**Post date:** [August 15, 2024, 3:46am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/2 "2024-08-15T03:46:34Z")

</div>

Hello @Kevin_K; I find HTTP POSTs tricky too.

Yet with a bit of processing, for the multiple array values we can submit them like so.

 ![Screenshot 2024-08-15 at 11.39.52](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/9/e91fb621764dc9ff80e4b8bc7394d726af060cab.jpeg)

However, that example isn’t dynamic enough, and the blueprint below simulates your data to do so using an Iterator and Text Aggregator.

 ![Screenshot 2024-08-15 at 11.45.30](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/0/b05d1d6102423e0069454c8fddc58dd005226d38.png)  
 ![Screenshot 2024-08-15 at 11.45.46](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/d/5da29b27c582c3edb52c090648cf386479b234aa.png)

[blueprint.json](https://community.make.com/uploads/short-url/oZnmWXmBu05y7xZmbUJFrBQX5TS.json) (13.2 KB)

Have fun!

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 15, 2024, 4:08am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/3 "2024-08-15T04:08:30Z")

</div>

That is awesome! I am so close, the text aggregator is now outputting dynamically generated secondary\_group\_ids as expected

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/8/58bfbf1ffa0caa4832602acb202b250bf107ed53.png)

However the Make a request module is expecting the query as an array.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/8/b81ba9413d33f4e3ca85d0d00df99b0f4ae940f5.png)

I have tried converting to an array with the toArray() function to no avail - any words of wisdom?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/a/8/a83ea53ecfe1209820f984b970795090d74e1f89.png)

---

<div class="post-metadata">

**Author:** ![ImMichaelCannon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/immichaelcannon/32/48674_2.png) [@ImMichaelCannon](https://community.make.com/u/ImMichaelCannon)\
**Post date:** [August 15, 2024, 4:39am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/4 "2024-08-15T04:39:09Z")

</div>

@Kevin_K; please share the API documentation reference for that call.

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 15, 2024, 4:58am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/5 "2024-08-15T04:58:55Z")

</div>

> **[REST API endpoints (2.2)](https://xenforo.com/community/pages/api-endpoints/#route_post_users_id_)**
>
> This document assumes you have already created an API key and setup the necessary headers for your request. Learn more about using the API.

Thank you so much for your time

---

<div class="post-metadata">

**Author:** ![ImMichaelCannon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/immichaelcannon/32/48674_2.png) [@ImMichaelCannon](https://community.make.com/u/ImMichaelCannon)\
**Post date:** [August 16, 2024, 4:26am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/6 "2024-08-16T04:26:09Z")

</div>

Hello @Kevin_K, thanks for the API docs. Seeing `integer[]` got me going [back to basics with a refresher of passing arrays in a POST](https://stackoverflow.com/questions/6243051/how-to-pass-an-array-within-a-query-string).

In [searching further through XenForo](https://xenforo.com/community/search/4974916/?q=secondary_group_ids&o=relevance), I see the CSV style of data passing.

So I’m wondering whether simple passing `secondary_group_ids=61,56` has worked for you.

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 20, 2024, 3:29am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/7 "2024-08-20T03:29:54Z")

</div>

> [@ImMichaelCannon](#):
>
> secondary\_group\_ids=61,56

Thanks for the pointer, passing the following formats:  
secondary\_group\_ids=61,56  
secondary\_group\_ids=61,56  
secondary\_group\_ids=61,secondary\_group\_ids=56  
secondary\_group\_ids=61secondary\_group\_ids=56

all result in the error whereby **qs** is expecting an array - based on the error - is this the make http module returning the error and not actually the web server?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/c/9cb76b943e54cd14165b86d7e2dea59c9739ff46.png)

---

<div class="post-metadata">

**Author:** ![ImMichaelCannon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/immichaelcannon/32/48674_2.png) [@ImMichaelCannon](https://community.make.com/u/ImMichaelCannon)\
**Post date:** [August 22, 2024, 9:00am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/8 "2024-08-22T09:00:39Z")

</div>

Did `secondary_group_ids[]=61&secondary_group_ids[]=56` work?

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 23, 2024, 4:58am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/9 "2024-08-23T04:58:08Z")

</div>

Unfortunately no - that results in the same error

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/1/6/160d0a0f00afa95e186df7a47391be996144b138.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/e/0ed06486def76d375f7d636f73875b7f81d0be29.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/1/2/12aa1161609252bfda97edeedf5f5bcefed70885.png)

---

<div class="post-metadata">

**Author:** ![ImMichaelCannon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/immichaelcannon/32/48674_2.png) [@ImMichaelCannon](https://community.make.com/u/ImMichaelCannon)\
**Post date:** [August 23, 2024, 1:57pm UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/10 "2024-08-23T13:57:24Z")

</div>

This is frustrating, and I’m not in a position to debug further.

Any luck getting the support team to send you an example of a similar request?

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_K](https://community.make.com/u/Kevin_K)\
**Post date:** [August 30, 2024, 1:30am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/11 "2024-08-30T01:30:05Z")

</div>

Finally got it to work!

Had to add an array aggregator into the mix to create an array with an appropriate key value pair.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/1/516415b2738c72b46f5487b65b17ad5b42f4cbdf.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/f/6f012d7495a762475570fa35fcca596551434756.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/1/5/1596cd36bce0ca9d02b9c0c382eb0bcb75bba28e.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/4/9/49697a902d067ae1814e02d80a7f50d8620a59eb.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/d/ed17a56f431e7adbc42f6098554b628c0dff337b.png)

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [September 13, 2024, 1:36am UTC](https://community.make.com/t/passing-all-values-of-an-array-into-a-single-x-www-form-urlencoded-body/50883/12 "2024-09-13T01:36:14Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.


