© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
LukasV

how to flatten returned data from joined tables?

I have a recipes table and instructions table where I store JSON instructions, at the moment I join these tables like this:
  let { data, error, count } = await supabase
    .from('recipes')
    .select(
      `*,
    instructions(instructions)
    `,
      { count: 'exact' }
    )
    .eq('id', id);
  let { data, error, count } = await supabase
    .from('recipes')
    .select(
      `*,
    instructions(instructions)
    `,
      { count: 'exact' }
    )
    .eq('id', id);

But I get the data this way:
ingredients: (2) [{…}, {…}]
instructions: {instructions: '{"root":{"children":[{"children":[{"detail":0,"for…format":"","indent":0,"type":"root","version":1}}'}
ingredients: (2) [{…}, {…}]
instructions: {instructions: '{"root":{"children":[{"children":[{"detail":0,"for…format":"","indent":0,"type":"root","version":1}}'}

How can I flatten my returned data, so that I don't have to call
instructions.instructions
instructions.instructions
?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Webhook data from multiple tables
SupabaseSSupabase / help-and-questions
3y ago
Paginating two joined tables with range()
SupabaseSSupabase / help-and-questions
4y ago
Manipulate Returned Data
SupabaseSSupabase / help-and-questions
4y ago
How to select from two tables?
SupabaseSSupabase / help-and-questions
4y ago