In my app, users can upload documents which be viewed by other investors not part of their company. The documents users can upload are optional and not mandatory. These docs are each saved as unique fields within a company thing.
However, for the docs that do get uploaded, How can I display the uploaded docs so they appear on the page in no fixed position but they go from left to right, top to bottom. (as I dont know which docs the user will or will not upload). So only docs that are uploaded are displayed and in no fixed position but rather, they populate a table as they get uploaded.
Repeating groups only display one kind of thing at a time, based on the list they’re given. So if you want to display a list of documents, you need a thing to represent each document.
You can’t automatically distinguish between fields on a thing. You get all of the fields or none of the fields. So if you want to ignore any “blank” field that information probably needs to be more like a ‘tag’ on a document than a ‘slot’ the document goes into.
What you can do is create a table for all documents. Then the document thing can have fields like “file” and “company”. So you can search for any documents belonging to this company and you’ll get a list of documents which you can drop into the repeating group.
I mean go to the Data tab in the editor and create a new thing/table called “documents” then create some fields on it like “file” and “company”. Then, when you want to display a company’s documents, search for the thing/table “documents” with company=this-company. You’ll get a list of thing/table “documents” which the repeating group can display properly.
When you’re starting out it’s most intuitive to create fields all together in one thing/table, but after you try using the data you’ll learn it’s better to find what you want by searching whenever possible. Just trying to point you in that direction.
However, when I search for Company docs (when company = current page company (which is good), I can’t seem to just pull every file field - it seems to make me choose a specific file within the company docs.
How can I work around this? I want every file within the Company Documents to be shown (and able to be downloaded by another user type) so long as the file has a value.
The table Company Docs should look more like this
field: company name
field: file
field: file type
Then you just put one file into each row of the table Company Docs. That way when you search you get one file in each item of the list. Then you get one item/file in each cell of the repeating group.
Can I not just call all the file-type fields within that list?
sorry - am confused with creating a file type in addition to the actual file itself.
For example, one of the docs in the Company Docs is a Shareholders Agreement.
This is an uploaded file within company docs, how would I define its file type?
You can’t make a list of fields. You can only make a list of things (rows from a table).
So, since you need a list of files, you’ll have to put each individual file into its own row.
Bubble made a mistake when they changed the name of “tables” to a couple different names. In different places Bubble calls “tables” instead “custom data types” and “things” and probably a couple others I’m forgetting. Anywho, so what you need is a “custom data type” that has a few fields like “file”, “company name”, and “file title”. Something like that. Then just run a search for “company name” and you’ll get a list of rows from that table. If you put all of the files into the same row they can’t be in a list. You’d only be able to have a list of companies or a list of groups of files.
I can’t tell if you’ve done this already, but drop a text field into the cell and set its text to the current cell’s company docs’s file name. That should show you a different file name in each cell.
In the debug menu, use the inspect button to look at that dataroom repeating group. You’ll be able to see the contents of the list it’s got as its data source. If the items in the list look right, then the search works and you just need a better way of displaying the results.
Just copy the link in the URL bar when you’re in the editor and paste it into the forum post. Make sure settings > general > application rights is set to at least “everyone can view”.
so - i want each of the Company Docs for that specific company to be presented in this grid so other users can download them. Am using a repeating group. When I preview the app - no data shows for me even though i have company docs in the app data.
You have to access the page from somewhere in the app that actually sends a Company to the page. That’s likely the problem here. If you run the app from the beginning and pick a company, that should make a difference.
Since the page type is company, you need to have a Company passed to the page for it to work properly.
So it looks like you have a field on the Company called Company Docs, but files aren’t ever getting added to that.
You need a workflow step that says, “Make Changes to thing.” You will be changing the Current Page Company. Then, the field you are changing is “Company Docs” add “result of previous workflow step.”
In this case, the previous workflow step is the creation of a Company Doc.
If you go this route, you can then populate the repeating group with “Current Page Company’s Company Docs” instead of doing the search that’s happening now.