Selecting the output from an API
Options
Mary Jane Pender
Member ✭
I have a table of Users who create Orders
I have table of Suppliers who fulfill Orders
Orders table has two relationships - Users and Orders
I have an API that filters all the orders by User (GET orders_of_user) and displays the Supplier record id rather than the Supplier Name. How to get the Output to return the content of the supplierName column.
In SQL I would do something like this,
Select Orders.ordernum, Orders.orderdate, Orders.total, User.name, Supplier.name
WHERE Order.userid = User.id
AND Order.supplier_id = Suppliers.id
How to I revise my GET orders_of_user (just like Prakash's Stuff_of_user from the youtube videos) to pull the supplierName from suppliers table based on the suppliers_id in the api response.
I have table of Suppliers who fulfill Orders
Orders table has two relationships - Users and Orders
I have an API that filters all the orders by User (GET orders_of_user) and displays the Supplier record id rather than the Supplier Name. How to get the Output to return the content of the supplierName column.
In SQL I would do something like this,
Select Orders.ordernum, Orders.orderdate, Orders.total, User.name, Supplier.name
WHERE Order.userid = User.id
AND Order.supplier_id = Suppliers.id
How to I revise my GET orders_of_user (just like Prakash's Stuff_of_user from the youtube videos) to pull the supplierName from suppliers table based on the suppliers_id in the api response.
Comments
-
Hey you would use an Addon to decorate your API response with the supplier's name. You would just map orders.supplier_id to supplier.id when creating the Addon.
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