# Perspective - Creating a custom event on component

**URL:** <https://forum.inductiveautomation.com/t/perspective-creating-a-custom-event-on-component/33700>\
**Category:** Module Development\
**Created:** [April 6, 2020, 2:27am UTC](https://forum.inductiveautomation.com/t/perspective-creating-a-custom-event-on-component/33700 "2020-04-06T02:27:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 6, 2020, 3:13pm UTC](https://forum.inductiveautomation.com/t/perspective-creating-a-custom-event-on-component/33700/6 "2020-04-06T15:13:21Z")

</div>

Loading a schema as JSON isn't _quite_ sufficient to parse the extra details of the context (for reasons I'm not sure of, we have an internal method that does the whole process from a JSON file, but don't expose it.  
As a third party author, you need to make your own event descriptor(s) for as many custom events as you want to add. You can either create the JsonSchema manually in code, or use the same parsing methodology. Just take every object inside your `events` array and (for simplicity) move them into their own files. Then load these resources as well as your main component schema, and register your event descriptors. I added more detail to the previous thread you referenced with the solution to that OP's issue.

> [@Creating a component event](http://forum.inductiveautomation.com/t/creating-a-component-event/30403/16):
>
> For posterity; posting the solution to the issue with the script editor: As I vaguely alluded to, you're not able to (unfortunately) get the automatic parsing of schemas out of a single file that we use internally - which means that the main issue with your module at present is the single event object schema being supplied for all four component event descriptors. So, to start off, you'll want to move them into separate files, and also flatten them - you don't need separate name, description (…

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-creating-a-custom-event-on-component/33700)._
