Addon with an object / multiple reference
Options
Lars Hofstetter
Member ✭
Hello!
I want to make an Addon of a table column that is an object. I don't know how to do it or what to type in the route. (see screenshot)
I have a table of users that has a connection to a "competences" table. So a user can have multiple competences assigned to him. I know how to do it with only a single reference, but not with a multiple reference (object).
Can someone help? Thanks!
[Bildschirmfoto 2022-02-28 um 16.18.01.png][Bildschirmfoto 2022-02-28 um 16.16.29.png]
Comments
-
I'm not sure you can do this with addons as they are set up today. (others might set me straight on that.)
Apparently, you can do that! See 's comment below!
But - assuming no crazy details - you can generate the same effect for your API or function output using a little bit of clever function stack code. Just spinning some pseudo-code:
1) Iterate over your users
2) For each user,
a) pull the competence_id into a variable
b) initialize a blank array
c) Iterate over the competence_id to
i) get competence
ii) add the competence to the end of the array
d) Add the array to your user
3) return the users!
Let me know if you'd like to discuss this more - showing can be easier than telling, and concerns specific to your use case will drive how complex this needs to be, and where you might be able to get performance! -
addons can 100% handle this use-case. Also, just to clarify, your column appears to be an array not an object - it is a list of table references correct?
Make sure to create your addon from inside the array as prompted, for example:
[CleanShot 2022-02-28 at 14.45.04.png] -
I have same issue, could you please showing me how ? in video - Thank you
-
Michael's reply also on this thread shows how to solve this use case much more simply than the steps I laid out above. If it works for you, could save some time!
-
I have this exact same use case but can't get this to work from me. I create the addon from inside the array as indicated, but it's not actually adding anything on to the result
-
Some images that may be helpful:
Result before add-on:[Pre-addon.png]Output Structure before addon:
[pre-addon output.png]Output structure with addon:
[addon mapped.png]Result after addon:
[post-addon result.png] -
how do you have the Addon mapped? Can you provide a screenshot?
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