Xano's new expression editor and playground provide a powerful way to test and modify expressions without impacting your application's actual business logic. In this tutorial, we'll explore how to use this feature to streamline your development process and iterate quickly.
When you click on an expression in your function stack, the new expression editor UI opens up. Here, you can view and modify your expression using a combination of visual tools and written syntax.
On the left side, you'll see the expression itself. You can add variables, such as input parameters, context variables, auth variables, and environment variables, simply by clicking on them.
The right side contains two tabs: "Transformers" and "Learn Expressions." These tabs provide a wealth of options for manipulating your data, including filters, arithmetic operations, lambdas, and higher-order filters. This functionality allows you to substitute a significant amount of JavaScript code with concise expressions.
One of the most powerful features of the new UI is the playground. Instead of modifying your function stack directly, you can test your expressions in the playground without impacting your application's business logic.
To use the playground, simply hover over the "Run in Playground" button or press Alt+Enter. This will execute your expression using the context data provided below the editor.
The context data is initially populated with sample data adhering to the structure of your function stack's variables. However, you can modify this data to test different scenarios.
To create a new blank context, click "Create New Context." Alternatively, you can insert a new context based on your current function stack by clicking "Insert New Function Stack Context."
If you want to use real data from your application, you can copy and paste it into the context window. Xano will automatically format the JSON data for readability.
With your context data set up, you can use the playground to test your expressions thoroughly. Simply modify the expression in the editor, and the results will update in real-time in the playground.
This workflow allows you to iterate quickly and ensure your expressions behave correctly before integrating them into your function stack.
Once you're satisfied with your expression, you can update your function stack by clicking "Update and Close" or pressing Ctrl+Enter. Your tested expression will be integrated into your application's business logic, and you can continue building with confidence.
Xano's new expression editor and playground provide a streamlined workflow for testing and modifying expressions without disrupting your application's core functionality. By leveraging this powerful no-code tool, you can iterate quickly, supplement data on the fly, and build robust backend services with ease.
This transcript was AI generated to allow users to quickly answer technical questions about Xano.
I found it helpful
I need more support