how to exit a function?
Options
![Mitch](https://us.v-cdn.net/6037124/user_avatars/2157194.jpg)
Mitch
Member ✭
I have a function with a pretty extensive conditional tree. There are a few points where if a condition is met, I'd ideally like to end the function and send back the response.
What's the best way to do this?
The stop and debug does that - but is described as a testing tool - and requires setting up its own response. Not a big deal, but just made me want to confirm best approach.
Thanks!
What's the best way to do this?
The stop and debug does that - but is described as a testing tool - and requires setting up its own response. Not a big deal, but just made me want to confirm best approach.
Thanks!
Comments
-
you'll want to make sure your conditionals are set up in a way so when that condition is met nothing else in the function stack runs.
The other part to this is naming all potential responses as the same return variable and adding that as your response
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback