Instead of only showing the ID, can we display a specific field from the "ethn" table?
![Hanan Radwan](https://us.v-cdn.net/6037124/uploads/userpics/V5725J9TBIW8/nKOLJO73L1GHQ.png)
I am developing a school application that involves linking Xano and Weweb. I am facing an issue where I need to link multiple tables together, but the field name is not appearing in Weweb, instead, only the identifier is visible. For instance, when I link the student and school class tables together, the class ID is displayed instead of the class name for each student. I am looking for a solution to display the field name instead of the identifier. This issue is occurring in several points of the application.
Best Answers
-
Hi @Hanan Radwan - you can use an Addon to decorate the table reference with the related data
-
So you're wondering:
Parent
- id
-student_id[]
User/Student
-id
VS.
Parent
- id
User/Student
-id
-parent_id
Both are acceptable schemas. To me (and I don't know the full context of your app), the latter option having a relationship with the user is easier to work with. I tend to prefer working without nested lists or objects when possible but that's more of a preference thing.
Answers
-
Thank you, it works. I was using functions without any success 🤷♀️
-
Awesome, glad that worked!
-
Hello @Michael Udinski,
Thank you for your assistance.
The images provided illustrate the user table, which includes roles such as administrator, teacher, student, and parent. To accommodate the distinct data associated with each role, separate tables have been created.
The students have been successfully added to their respective table. Additionally, families have their own table .
Currently, the objective is to add the names of each parent's children to their designated field. Object binding has been utilized to achieve this.
While reviewing the data, it is possible to obtain parent information from the user table. However, retrieving student data has proven challenging due to the student's association with the student table through their user ID, which has undergone changes.
I hope the explanation provided is clear.
-
Hi @Hanan Radwan - Let me see if I'm following, you want to Addon the children's info to student ID? You would use an Addon, single return for this implementation.
Also, I suggest you use a table reference list instead of an object list for your list of relationships (unless you are storing additional data within each list)
-
Perhaps a parent has multiple children. How can I check this within the table reference list? Duplicate parent record for each child?
In my application, on the Parent page, I require displaying all the children along with their details who come under a parent.
P.S :For every table that I have, there are several distinct details.
-
Yes - this is still accomplished with an Addon. You will do an Addon to the list, since you have a list of children, your Addon will be of type single since each item in the list represents a single child.
-
To ensure best practice, I would like to clarify whether it is more appropriate to create a new record for each child in the parents table or link the parent ID from the user table with each child in the students table. Could you please advise me on the recommended approach?
-
The result I wanted was achieved
Even though I don't know if the API's output is correct, I now have all the information I needIs it possible to change its appearance without customizing it?
I want any new field I insert to be automatically added to the APIOne more thing
This image shows how I need multiple data from two tables for each student
What is the best practice here, in your opinion? -
Any new field will be added to the API if you do not check the box customize response. It will default to include all fields this way.
And you are able to do multiple Addons on any API so if you have related data in multiple tables, you can do multiple Addons
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