# Custom JS issues on workflow

**URL:** <https://community.weweb.io/t/custom-js-issues-on-workflow/8584>\
**Category:** How do I?\
**Created:** [May 13, 2024, 7:40pm UTC](https://community.weweb.io/t/custom-js-issues-on-workflow/8584 "2024-05-13T19:40:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brayxeh](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@Brayxeh](https://community.weweb.io/u/Brayxeh)\
**Post date:** [May 13, 2024, 7:40pm UTC](https://community.weweb.io/t/custom-js-issues-on-workflow/8584/1 "2024-05-13T19:40:16Z")

</div>

Hi! I want to have a custom JS code that verifies if the email input field has a valid value before proceding with the next workflow event.

I have this function added to the custom js area but it seems that there is not return value, what am I doing wrong?

Also, is there a way to do this using Formula?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/5/5e077c73861746d4e782ca7cd83926aed037f368.jpeg)

Thanks!

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [May 13, 2024, 8:22pm UTC](https://community.weweb.io/t/custom-js-issues-on-workflow/8584/2 "2024-05-13T20:22:19Z")

</div>

the js action is already the body of a function so add `return isValidEmail()` after the function declaration.

It’s also better to use `wwLib.getFrontDocument()` everytime you want to access the `document`, because of how weweb’s editor preview works.
