I’m building a page that allows the user to download a number of table elements from my bubble page about the users feedbacks. Basicaly, I thought about two ways :
1 - Building a full JS handled HTML table : Using the toolbox plugin, I run Javascript to retreive my data (from the feedback), then I build a table using JS logic, fill the data with the data from bubble, then I generate my PDF (using PDF co in make). This way works well, but it limits me from the other fields of the table I’m targetting (for example, I have a “sign” logic table, and if I’m passing the “feedback” data, from JS, I can’t do the logic as so to reach the other fields : feedback{i].fieldName)
2 - Create the view in Bubble, then retreive the full HTML : Still using toolbox, I retreive the HTML of the Bubble element (table element), then I generate the PDF using the obtained output. However, this disallows me to get the exact CSS, I seem to not be able to get the exact style I used on my Bubble element (with GPT, it allowed me to retreive a lot of CSS, but not exactly what I’m searching for, since there’s like a thousand of lines of CSS that isn’t usefull to the render, which isn’t really productive)
So basically, one method allows me to generate my PDF when I’m building everything using JS but I’m limited on the passed fields and conditions (except if I can reach the other fields), the other one allows me to use Bubble as the template but I can’t get the exact style.
I need some advices / tips, about how may I handle this please.
Hi @madecsalmanali it sounds like option 1 is giving you more control over the content and styling, and could offer a preview in an iframe. Can you elaborate on the limitation? Show how you are passing data to JS and there may be alternative approaches.
Indeed, the option 1 has more control, since I build the table on my own. The limitation I’m mentioning is accessing the others fields of the table, let’s take an example :
A table User with a uniqueID, a name, and an email.
Let’s say I get the data from Bubble like this : Search for User:firstItem’s uniqueID, using JS un a simple code snippet or a “run a javacript” : let user = “Search for User:firstItem’s uniqueID”; // eq : 1745a485458z4ax47 somehting like that for exmample.
In this example, the user is just a string, not the full user that would allow me to access the email or the name fields. Do I need to build a User model, using the same fields to build my User ?
I don’t know if it’s clear, let met know if there’s something missing in the explaination. Thanks
To get structured data into JS my preference is to build a JSON string using Bubble’s expressions, then in JS do JSON.parse(string), then Bob’s your aunty