# Trigger a javascript function from a custom action in Glide

**URL:** https://community.glideapps.com/t/trigger-a-javascript-function-from-a-custom-action-in-glide/57660
**Category:** Ask for Help
**Created:** [February 8, 2023, 1:18pm UTC](https://community.glideapps.com/t/trigger-a-javascript-function-from-a-custom-action-in-glide/57660 "2023-02-08T13:18:27Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [March 3, 2023, 4:48pm UTC](https://community.glideapps.com/t/trigger-a-javascript-function-from-a-custom-action-in-glide/57660/6 "2023-03-03T16:48:00Z")

</div>

Hola,

Try with this to start:

> [@Fetch json with token](https://community.glideapps.com/t/fetch-json-with-token/53097/7):
>
> Hola! I think it’s possible but if you share your cURL command (or Fetch syntax) we can try to fix it. Your JS code might look like: var data= await fetch('YOUR\_URL', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'YOUR\_BearerToken' }, }); const json = await data.text(); // or data.json(); return json Saludos!

Saludos!

---

_[View the full topic](https://community.glideapps.com/t/trigger-a-javascript-function-from-a-custom-action-in-glide/57660)._
