I’m trying again looking for help. I’d like to display a data field from a database table. The equivalent SQL statement would be “Select birthday from table personAttributes where user’s email = curren’t users email” (user is logged in so the context is known). I don’t want to pass data from page to page (doesn’t fit the workflow) and repeating groups doesn’t fit the use case. (I’m storing the users email address in personAttributes as a foreign key so I can link the two).
From a traditional programming world this is very simple to do. With bubble it seems like it can’t be done. Thanks in advance for your thoughts.
I’m not sure I understand what you’re asking for, but I’ll try to help out. If I understand you correctly, I think what you want to do is display the current user’s email in a text field on a page. Is this correct?
Hi and thank you for your response. I’m grateful you’re willing to help me figure out how to do something that at least at the moment seems not possible.
I’ve actually displayed the current user’s email in a text field on a page before from the user table in the database but what I cannot do is display a piece of data from another table in a text field on a page (one that I’ve created). For example, I have created a table called parentData with the first name, last name, birthdate, gender, etc. I want to display for example a single parents first name from the parentData table in a text field. I also have a childData table for storing child data associated with a single parent(there could be multiple children).
The use case is that I’m building a registration form for parents to enroll their child in school. Once they fill out the form, the data goes into the database and then I pull the data from the database into another form that is pre-formatted for printing a pdf contract that the parent can print out for their records.
Repeating groups are of no use because it is a single parent and single child that I want to display in a text field on the second page for printing unless you can use repeating groups as an array that you can search through for specific data entries. URL cookie passing could work from the initial entry form to the final printable form but I can’t figure out how to get multiple group objects into the URL.
Thank you for your offer of help. I appreciate it.
Brian
Do you have “parentData” linked to a User? It might be easier to open up your app and share the link to the editor so we can see how things are structured.
Sorry for the slow response. I was busy publishing the final app for production tomorrow. I cut out the functionality I was trying to accomplish for now.
There is a field in parentData named created by which is the same as the User’s email. So in that sense, yes there is a reference-able point or “link”. I’m not sure how to share a link but I’ve created a copy of the application here: https://bubble.io/page?name=index&id=pre-enrollment&tab=tabs-1
You can create an account and login…it’s open to anyone. I deleted the button from the page “home” that would take you to the page “pdftoprint”. What I’ve found with the Bubble platform is that it’s buggy and the development environment does not match the production environment. Data is also slow to show up in the data table view. I had to wait almost 10 minutes yesterday for data to show up there. That can get frustrating!
I’ve not seen an incident where the development environment didn’t match production. That sounds really weird. Aside from the data, there should be zero differences. Do you have an example of a difference?
I do indeed. In the development environment I have a table called childData. When a user submits a form one of the workflows is to take data from the form and insert it into childData. All the fields populate fine in the database except a field called parentEmail which in the worklflow editor is “parentEmail = Current User’s email”. This functionality does not work in Development Preview but does work in the Production environment. For this reason and others I just deploy to production all the time when developing my app before it is live.
Another anomaly, which I think is a bug, is that when you set an image to “fixed width” and then choose to not set it to “fixed width” things get super wonky and the best solution is to delete everything and start over (create a new group, insert the same image again). I think Bubble does not properly clear the “fixed width” field after you un-check it and it ends up being easier to start over than futz too much with it.
I actually work for a major software company (Oracle, but in the hardware division) so maybe my expectations are different.
If you have a field set to have the type “User” then you can do this linking via Bubble, rather than a “foreign key”. It will be easier and faster than doing all the linking yourself.
The anomaly with the dev/live isn’t something I have seen before either. Best way to get some help would be to post a link to the app, after making it public.
I have made a copy of the app public (I have a production version running of this) and it’s available here:
Hopefully the link works. The behavior of fields is completely different in dev mode than in production on the pdftoprint page. In dev, no data shows up. In production most of it works. I essentially gave up on getting this stuff to work and went to a manual process.
There is no data in the app so you will need to log in and create some data or you will need to manually add it into the database. I have spent over 100 hours using bubble and have run into many inconsistencies in the platform. Maybe it’s my lack of experience (or maybe because of my experience with PHP and other platforms) that hinders me from “getting” the paradigm here. Hopefully you can find some time to poke around.
Can you be a bit more specific about what you are having difficulty with?
From your database setup you can have multiple records (for a user) for parent and child.
I think you would be better off storing the parent data on the User table ?
Then you just have multiple child enrollment records. As the User is tied to email address anyway, you can use “Creator” for your search rather than storing the email address.
Sorry for my slow response. My difficulty is half having the dev preview environment match the production environment and half with Bubble concepts. I thought the User table was reserved so that’s why I didn’t use it but using it would certainly help solve a lot of problems, especially if you are doing URL data passing. I agree with your assessment. However, I’ve had trouble developing because of platform inconsistencies. Here are two screen shots of my environment, one in production and one in dev preview. They look completely different.
The first is dev preview, the second is production. The behavior could not be more different. I whited out the email addresses. Have you seen this before? It gives me pause, and doesn’t inspire a lot of confidence. Thanks! Brian
To me, it just looks like the database is different from dev to production. All of the elements on the page look the same. Do you have valid data in both the Preview and Production databases?