Pull data from another table, via ref. id in API
I have a database which contains user submitted entries called 'Entries', each entry is made up of answers: 'Input1' 'Input2' 'Input3', to a number of prompts:
[Screenshot 2022-03-13 at 13.47.35.png]
The prompts are pulled from a separate database called 'Guided Exercises' and are associated with each entry by a 'guided_exercises_id'.
[Screenshot 2022-03-13 at 13.47.35.png]
What I want to do is display a users 'Entries' in my front end, and also pull the prompts, along with the answers, using the Guided Exercise ID. So it would look something like this in the front end:
Prompt 1: How do you feel?
Input1: I feel energetic
Prompt2: What have you done today?
Input2: Gone for a run
Here is that my API to get (and decrypt) the Entries currently:
[screencapture-xnld-vjkh-drol-e2-xano-io-admin-workspace-1-api-1-query-61-2022-03-13-13_53_47.png][Screenshot 2022-03-13 at 13.54.20.png]
How can I make this API also make the guided exercise prompts, pulled via id, part of this result?
Other
2 replies