Connect tables

Options

Hello,
I'm new to Xano and began with creating my back-end which is super exciting but at the same time challenging for me, having no background in coding!

My objective is to create a web application where users can set one to many objectives and define a tailored strategy for each of these objectives.

In terms of tables, I created:
1) A users table
User 1
User 2
User n

2) An objectives table :
Objective A
Objective B
Objective n

3) A strategy table: Each strategy type (1, 2, 3 ) is associated with a given return (e.g. strategy 1= 10%, strategy 2=15%, etc)
Strategy 1
Strategy 2
Strategy n

What I try to accomplish: I would like to be able to define that each user can select one to many objectives and for each objective, select a dedicated investment strategy.

I tried many things with objects, enums, etc, but failed so far. Could someone guide me to how I should structure this to make it work ?

Thank you

Best Answer

Answers

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Hi,

    From the top of my head. I would create a list of objects in your user table that have at least those two fields objective_id(relation to objective table) and strategy_id(relation to strategy table).

    This way you can have a list of many objectives and for each of them assigned strategy, additionally in your endpoints you can use addon feature to pull data from both objectives and strategy table via those table relations.

    If you are interested I would be happy to help you with the difficult parts of your project, just drop me a message: pmagdanski@gmail.com


    Additionally I can highly recommend @Ray Deck and his statechange.ai as a great source of knowledge and help in Xano and no/low-code in general.

  • Mr Unfreeze
    Options

    Hi Pawel,

    I tried that but I don't think I understood how to proceed here.

    I created rows for each objective and strategy type in their respective tables but can't find how to select these from the user information table. I tried using enum but I can only select one. How should I modify that ? thank you!



  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    You should table reference:

    Then in your endpoints you can either join tables via those references or use addons.