# How to use custom functions from JS file in Test Designer

1. We are calling the JS function from the DS script and it returns the values after evaluation
 
The JS function that we have created is shown below

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/VsgzdZafeZ0RjkPU-b2d15578a9c8.png)This function will calculate a 10% discount on a Price that is entered. The usage of function in TD script is shown below

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/JkhfWQs0WC8KPKta-40fab5636b65.png)2\. We can also make use of the Custom JS action in DS and then fetch the value using the locker

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/wDmjsG6bgaEnIwTN-08ddc2c4dee9.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/iCCjRRJftNCxa0No-c20497d428ee.png)<div id="bkmrk-last-updated%3A-june-2">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">June 26, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>