Best practice connecting with Bubble

Options
Hi there,

I am trying out Xano in combination with Bubble in a way that I store no data in Bubble DB, just to see if it is possible.
The question I am having now is what's the best practice for my setup to generate the JSON Payload for a call to Xano (For Example: Create Invoice (Post), Create InvoiceLine (Post), Delete InvoiceLine (Delete), Update InvoiceLine (Put).
Currently I am trying to create JSON from a form and save it to (lists of) custom states (text). It works but it is a bit cumbersome when I want to also preview the data in Bubble as a styled Invoice preview (before sending it to XANO)
The other approach I am thinking of is to store Invoice and Invoice Lines temporary in Bubble. For example. When I create an Invoice using the form. A Invoice record is saved in the Bubble database. Then Invoice Lines are added also in the Bubble database
. When pressing “Save Invoice” button I post the invoice and invoicelines to Xano and when it succeeds I remove the Invoice/Invoice lines from Bubble.
Yet another option is to store the invoice in local storage using a plugin. Could that be the best way to follow?
No I am wondering, what approach do you all have?

Comments

  • Chris Coleman
    Chris Coleman Administrator

    ADMIN

    Options
    I think your approaches are valid either way, honestly.

    1) Storing temporarily in Bubble -- this is good, my only concern would be if there is a reliability or speed issue vs another approach. I'm not a Bubble expert myself, so you'd be able to determine this better with testing.

    2) Storing invoice in local storage -- this is probably the most performant, but if a user closes their window before submitting, that data would be lost, correct? Probably not ideal.

    The only other approach I could think of (and not sure I'd recommend) is to modify your function to become an "add / edit record", so that essentially the data is submitted to Xano, a preview is generated, Bubble then reads that invoice data from Xano and the user has a chance to go back and change, and the record is then updated on save.