Nested addons don't seem to work when response is customized

When I customize the response of an addon:

and use this addon in the output of an API, I can define a nested addon (in this case User). However, the data returned when I actually call this API do not include user details

When I undo the response customization of the addon, it works again as expected

Hi @jeroen welcome to the forum, thanks for your first post!

Can you tell me a little bit more about the Addon? You said it’s nested: is it nested underneath another Addon? Did you create the Addon from the library - and if so, is that output customized? Or did you create the Addon from the output tab of the query?

Lastly, what browser are you using? I noticed the UI looks a little different on the screenshot, we recommend Chrome for the best experience.

Hi @michael, thanks for the warm welcome.

This is the situation: I have the following tables and references: Artwork, has an Artist, Is a User
I’ve created addons from the output tab of the query in the GET /artwork API. One addon to add the artist details to artwork and one addon to add user details to artist. Run&debug this setup returns the records including nested details as expected.

When I customize the output of the artist addon via the library (for example deselect the created_at column) and run&debug the GET /artwork API again, the artist details are returned in the customized output as expected, however the user details aren’t. Which is not what I would expect.

I’m using Firefox on Ubuntu.

Output of Run&Debug as expected:

Customized response in the artist addon from the library:

Customized output of the addon is reflected in the API definition as expected:

However this is not reflected in the output of Run&Debug:

So since you created the Addon in the Output tab of the query first, that response set up for that specific query should take priority over response changes in the library afterwards. But, after making changes to the response in the library - if you add that addon anew in a different place then the customized response will reflect.

Each query where the addon is added will take priority for the response because in different scenarios you may require different information returned.

Thanks @michael ,
With that reasoning I would expect that the Addon in the Output tab of the query wouldn’t change when that addon is changed via the library. However, it clearly does. In fact, the output tab of the query then shows the customized output from the library addon change even though it wasn’t added anew. And it includes the nested addon for user which was originally in place. However when running that query it returns a different JSON structure than what was modeled in design time.
Am I missing something here?

Having a chance to digest this - it sounds like you customized the response to the Artist addon and it sounds like you expected a change to the user addon? You would have to change the response of the user addon to reflect any change to that Addon.

So, to clarify response output of Addons (I’ll make a tutorial on this):

  • Customizing the response of an Addon from the library is like setting a “default” response for the Addon, this default would be reflected anytime you use that Addon in a query and do not choose customize output.
  • If you are using an Addon in a query function somewhere, and do not customize the response, it will take the default response from the library (this is the same exact point as above). So, if you go back to the Library and make changes, these changes will be reflected on the Addon that is being used in the query without a customized response.
  • If you are using an Addon in a query function somehwere, and choose to customize the response, this will be the settings for that specific addon and that specific query.

Trying to follow your thought here, I think what I’m trying to do matches with the first option you mention. So I’m using an addon in a query function and I’ve customized its response (Artist in my example) via the library. This customization is subsequently visible in the query function, which is what I expect and also understand from your explanation that that is how it’s designed to work.

This particular addon (Artist) that is then used in the query function has a nested addon (User in my example) which does not have its response customized. This situation is correctly reflected in the second last screenshot. So far so good, everything as expected.

However, when I run & debug this API the results returned are without the User details. Isn’t that incorrect?

Hi Jeroen, I apologize as I was not clear on the issue! I was reading this as something else. Well that definitely looks like a bug and the engineers are looking at it. I will update you once we push the fix!

Hi @jeroen - we have just pushed an update to Xano with the fix for this bug! You should be able to customize your Addons and they should behave as expected.

1 Like

Thanks for the fast response @michael. I retested it and can confirm it works as expected now

1 Like