# Request Body for multipart/form-data from Collection Variables

**URL:** <https://community.postman.com/t/request-body-for-multipart-form-data-from-collection-variables/36856>\
**Category:** Help Hub\
**Created:** [July 5, 2022, 7:55am UTC](https://community.postman.com/t/request-body-for-multipart-form-data-from-collection-variables/36856 "2022-07-05T07:55:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamsven](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jamsven](https://community.postman.com/u/jamsven)\
**Post date:** [July 5, 2022, 7:55am UTC](https://community.postman.com/t/request-body-for-multipart-form-data-from-collection-variables/36856/1 "2022-07-05T07:55:58Z")

</div>

I have an example for what I want in `application/json`

Here’s what I do for `application/json`

In Collection Folder Pre-request Script, I add this:

```auto
const loginRequest = {
    "Username": "test",
    "Password": "testpassword"
};
pm.collectionVariables.set("loginRequest", JSON.stringify(loginRequest));

```

And in the request body, I just choose `raw` type and put `{{loginRequest}}` in that.

Is it possible to do this for `multipart/form-data`?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 29, 2025, 3:33pm UTC](https://community.postman.com/t/request-body-for-multipart-form-data-from-collection-variables/36856/2 "2025-04-29T15:33:52Z")

</div>

Closed on April 29, 2025, 3:33pm UTC


