# Use form data in api

**URL:** <https://community.glideapps.com/t/use-form-data-in-api/77641>\
**Category:** Ask for Help\
**Tags:** api, actions\
**Created:** [November 5, 2024, 5:11pm UTC](https://community.glideapps.com/t/use-form-data-in-api/77641 "2024-11-05T17:11:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yahya\_banouk](https://avatars.discourse-cdn.com/v4/letter/y/b19c9b/32.png) [@yahya\_banouk](https://community.glideapps.com/u/yahya_banouk)\
**Post date:** [November 5, 2024, 5:11pm UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/1 "2024-11-05T17:11:16Z")

</div>

When a user submits a form, I want to use the values he set in an API call as parameters, how can I do that ?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [November 5, 2024, 5:17pm UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/2 "2024-11-05T17:17:24Z")

</div>

You can use onSubmit Action on your form:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/4/042c37dd3fd4b6e54e8dd3d9b7100bb4dc93ba3d.png)

If you are using JSON for the body of the API you need to call, create a JSON template computed column first on the row:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/c/9cf27f0d02a86e0549b670dc2de2757d9e77757a.png)

Then, in your custom action, use that column as the body:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/2/720389846a569a5632219d0577bafa3a0206d2b6.png)

Set an endpoint and the method. Add required headers and queries for your API.

You can optionally want the result to be shown in another column. You can do that by setting the Response Body to a specific column.

Now, when a user submits the form, that action will be triggered and your API will be called.

---

<div class="post-metadata">

**Author:** ![yahya\_banouk](https://avatars.discourse-cdn.com/v4/letter/y/b19c9b/32.png) [@yahya\_banouk](https://community.glideapps.com/u/yahya_banouk)\
**Post date:** [November 5, 2024, 9:59pm UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/3 "2024-11-05T21:59:35Z")

</div>

@MaximeBaker thank you so much but i wanna use the form values in the params of the api not on the body with GET methode how can i do that please ?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [November 5, 2024, 10:23pm UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/4 "2024-11-05T22:23:44Z")

</div>

Use the query section. 🙂

---

<div class="post-metadata">

**Author:** ![yahya\_banouk](https://avatars.discourse-cdn.com/v4/letter/y/b19c9b/32.png) [@yahya\_banouk](https://community.glideapps.com/u/yahya_banouk)\
**Post date:** [November 6, 2024, 8:08am UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/5 "2024-11-06T08:08:36Z")

</div>

Yes you’re right, thank you so much

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [November 13, 2024, 8:09am UTC](https://community.glideapps.com/t/use-form-data-in-api/77641/6 "2024-11-13T08:09:12Z")

</div>

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