Data Management

Subpath: Parse Through Data Visually

Summary

Hello there! Welcome to this step-by-step guide on using Xano's powerful SubPath feature. If you've ever found yourself dealing with large JSON responses and struggling to navigate through the data to get exactly what you need, this feature is going to be a game-changer for you.

Let's dive right in!

What is SubPath?

SubPath is a handy tool in Xano that allows you to parse through complex JSON objects and extract the specific data you need. Whether you're working with responses from external API calls or large query results within Xano itself, SubPath makes it a breeze to navigate through the data and access the exact information you require.

Step 1: Obtain the JSON Response

The first step is to obtain the JSON response you want to work with. This could be from an external API call or a query result within Xano.

External API Call Example

  1. Create an API endpoint in Xano.
  2. Make an external API request (in this example, we're using the Star Wars API for planet data).
  3. Run the API endpoint and copy the JSON response using the "Copy Result as JSON" button.

Xano Query Example

  1. Create a query in Xano (e.g., "Query All Results" from a table).
  2. Copy the JSON response using the "Copy Result as JSON" button.

Step 2: Create a Variable with SubPath

  1. Add a new function stack item in Xano.
  2. Go to the "Data Manipulation" section and click "Create Variable".
  3. Give your variable a descriptive name (e.g., "ResultsWeWant").
  4. In the "Value" field, paste the JSON response you copied earlier.
  5. Click the blue "SubPath" button next to the variable name.

Step 3: Define the SubPath

  1. In the SubPath window, paste the JSON response again in the "Input Value" field.
  2. Click the "Define" button.
  3. Xano will now display the structure of your JSON object, allowing you to navigate through it.
  4. Expand the sections until you find the specific data you want to access (e.g., "response.results" for the Star Wars API example).
  5. Click on the desired data element, and Xano will automatically populate the correct dot notation path for you.
  6. Click "Save" to apply the SubPath.

Step 4: Use the Variable

Now that you've created a variable with the specific data you need, you can use it in your Xano logic however you see fit! You can return the variable, manipulate the data further, add it to a database, or use it in any other way you require.

For example, if you want to display the extracted data, simply return the variable, and Xano will show you the result.

That's it! You've successfully used the SubPath feature in Xano to navigate through a complex JSON object and extract the data you need.

Conclusion

Xano's SubPath is a powerful tool that simplifies working with large JSON responses. By allowing you to visually navigate through the data structure and automatically generating the correct dot notation path, SubPath eliminates the hassle of manually parsing through complex objects and reduces the risk of errors.

Whether you're a no-code enthusiast, a citizen developer, a traditional developer, or a startup/small business looking to build and deploy applications quickly, Xano's SubPath feature can save you valuable time and effort.

Give it a try and experience the convenience of seamlessly extracting the data you need with just a few clicks!

This transcript was AI generated to allow users to quickly answer technical questions about Xano.

Was this helpful?

I found it helpful

I need more support
Sign up for XanoSign up for Xano

Build without limits on a secure, scalable backend.

Unblock your team's progress and create a backend that will scale for free.

Start building for free