# Creating a custom function

**URL:** <https://community.dreamfactory.com/t/creating-a-custom-function/1735>\
**Category:** REST API\
**Created:** [November 6, 2015, 6:56pm UTC](https://community.dreamfactory.com/t/creating-a-custom-function/1735 "2015-11-06T18:56:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iangrech](https://avatars.discourse-cdn.com/v4/letter/i/f4b2a3/32.png) [@iangrech](https://community.dreamfactory.com/u/iangrech)\
**Post date:** [November 6, 2015, 6:56pm UTC](https://community.dreamfactory.com/t/creating-a-custom-function/1735/1 "2015-11-06T18:56:49Z")

</div>

Hi all;

I just got to know of DreamFactory and downloaded and installed on an Ubuntu desktop VM. I successfully connected to a local MySQL db and had API created by DF. Now I want to create some customer endpoints. I go to Scripts from teh top menu but do not have a ‘Create’ button. How do I proceed?

Please bear witha beginner.

Thanks  
I.

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [November 6, 2015, 7:50pm UTC](https://community.dreamfactory.com/t/creating-a-custom-function/1735/2 "2015-11-06T19:50:06Z")

</div>

If you seek to create a script that is triggered on an API event, you will need to navigate on the left-hand side through ‘Process Event Scripts’ \> {service} \> {service.component} \> {service.component.verb.trigger}, at which point the Script Type/Language selector, Active checkbox, and script editing window will be enabled.

E.g., if I wanted to create a script that is triggered prior to the service call every time the table called “todo” from the service called “db” was called with a GET verb, I would navigate to `Process Event Scripts > db > db._table.{table_name} > [GET] db._table.{table_name} > db._table.todo.get.pre_process`

 ![](https://canada1.discourse-cdn.com/flex035/uploads/dreamfactory/original/1X/8309da7d04f69bff0512a110594b70ed69cbcc71.png)

If you wish to create a script service that is executed when it is called directly as an API endpoint, navigate to the Services tab and create a service with type ‘Custom Scripting Service’, then enter your script on the Config tab.

![](https://canada1.discourse-cdn.com/flex035/uploads/dreamfactory/original/1X/7512f55e0443be25b03de0a0ec46ffda24b57cd2.png)

I recommend our [tutorials](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Server_Side_Scripting), which walk you through creating two types of triggered scripts as well as a custom scripting service for each scripting engine that is available (V8 JavaScript, Node.js, and PHP).

[Scripting Tutorials on the DreamFactory Wiki](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Server_Side_Scripting)

---

<div class="post-metadata">

**Author:** ![iangrech](https://avatars.discourse-cdn.com/v4/letter/i/f4b2a3/32.png) [@iangrech](https://community.dreamfactory.com/u/iangrech)\
**Post date:** [November 7, 2015, 2:22pm UTC](https://community.dreamfactory.com/t/creating-a-custom-function/1735/3 "2015-11-07T14:22:20Z")

</div>

Thanks Jeffery. This is just what I was looking for.

I.
