Data source fields: searching tables and pulling data beyond just the 'first item'

I have an app where users enter a bunch of data about a project via multiple forms. Each form corresponds with its own table within the app. There’s about 10 tables in total and most of them are normal single text datatypes - the user creates a project and their single answer counts against the project’s name and version. In other words it’s one response per question to one project/version.

Now, in a few tables, the user can record multiple entries under a project and version. For example, they might be detailing all the drugs they’re taking (name, dose, time of day, how many tables etc). So in this case, each drug might be considered a thing. A user could have multiple drugs each with its own variables. The form allows for this data collection and stores each additional response as its own thing, on a new row in the table. Each save of the form stamps the project name, and version so it’s clear what it belongs to.

For some reason I didn’t build such tables as lists of text, and I can’t exactly remember the reasons why, but a lot had to do with with the limitations of lists in bubble. I was satisfied that the data would be stored in the table nicely in its own row and I’d think about how to pull it out later - now is that later!

So, the blocker I’ve got now is this: as my app pulls these data into a document, I’ve created the Parent’s thing for the button that contains this workflow to ‘Search for the main database that links to all of these other tables’:first item.

Because of this expression, it pulls all the first items of those multiple rows (or pseudo-lists) I explained above. This expression disregards all other rows of data that match the project name and version constants I have set, and I need this data in the documents I’m generating.

In a repeating group Bubble allows me to simply do a ‘do a search for X table’ and add constraints. But when trying this when setting the data source in the group, it tells me that the table I’m trying to search is a list and I need specify the ‘first item’.

How can I use an expression as the data source for my ‘generate documents’ button so that it pulls all the data from the database and not just the first item, as long as the constraints are met?

I’m getting war flashbacks to Amendments

1 Like

Imagine what happened to me! :joy:
Now, I’ve just been hammered again with this new blocker

I would imagine your issue is gonna be pretty massive, if your entire app is looking for single things and now you want lists you are in for a treat…

You could’ve been right, but I managed to find a workaround.

I needed this whole this to pull all rows because I’m feed the data through an API. Irrespective of what I set in my parent group which houses the button to trigger this API workflow, the individual parameters I set for the API also ask me where to find the data. So instead of doing ‘Parent’s group thing’ (pointing to the group that houses the workflow button), I simply revert to doing a search which lets me choose the table and add constraints. I’ve tested it as it’s receiving all the data, which is a huge relief.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.