[SOLVED] Line-item data not displaying?

Hi guys,

I have a group for users to create an invoice and add line-items. The invoice is created on a group called create-invoice.

I would like to display the invoice and line-items information on another page. The ‘Save invoice’ button triggers a workflow before sending the user to a new page called ‘html-invoice’ with the data create-invoice's invoice

I am struggling to get the Line-items to display in the repeating group. Basically no line-item data is displaying?

It could be a privacy rules issue…

If not, then either there are no line items matching the search criteria, or the parent group doesn’t have any data loaded (no invoice).

So check those 3 things.

Thanks. I’ve checked those 3 and they are not the cause. As an example, see how the database has stored the invoice# …

… but when I try and show it on html-invoice it is blank.

I feel like the issue may be on how I am passing the data from the ‘Save invoice’ button to the new page. Maybe I should not send data, instead maybe I should just do a search for data once on html-invoice?

I’ve checked those 3 and they are not the cause

How have you checked that? In the debugger I assume, in which case just trace it backwards to find where the data is missing.

I’ll have to show my naivety here, I don’t see the benefit of the debugger because it just shows me the step by step actions, which I can easy see from looking at my workflow? When I perform a ‘save invoice’ in debug mode it just goes through the steps and arrives at the empty html-invoice page, I don’t get any additional info.

A little glimmer of hope, over the last hour I have tried many different things and am noticing that although my ‘Save invoice’ does not populate the html-invoice page, oddly, if I then return and click on my saved invoices and edit an invoice, it then does show data in the html-invoice page.

No, you need to use the inspect tool to check each element on the page (not the step by step workflow checker).

You’ll be able to see if it has data or not (and I’m fairly certain you’ll see that it doesn’t).

I see, do you mean to inspect the html-invoice page?

I was thinking that if editing an invoice does successfully populate the html-invoice page, then perhaps the database hasn’t properly updated before I click the initial ‘Save invoice’ because that does not populate the html-invoice page.

Yes, if that’s the page where the data isn’t showing as expected - use the Debugger to find out why.

Here’s an inspection of the invoice# section. This section should show the invoice number as the database does have that info stored. I am not sure what the debugger is telling me here? It seems to show there’s not info where the invoice# should be, but not sure how that helps me?

That page has no data - it’s no good running the debugger on a page with no data - you need to run it on an actual page (with actual data).

So load an actual page, then run the debugger on that - then anywhere where there should be data, but there isn’t, inspect the element and drill down into it’s data-source to see where the issue lies.

How can I run it with actual data on it? My issue is that I am unable to get actual data onto the page! If I could pass data from ‘Save invoice’ to html-invoice then I would not need to debug!

Possibly I am misunderstanding you?

you need to make sure there’s a unique Id or slug of an actual existing invoice in the URL path of the page

Ok gotcha, I will double check that, thanks.

The data being sent is the invoice’s page’s invoice, create-invoice's invoice. This would surely mean the invoice ID is being sent. I have checked, after sending an invoice we have a unique ID in the database but no slug. The line items are also there (but for some reason they double up, as though I have clicked the button twice).

I am not sure how to check unique Id on the URL path of the page, I’ve never done that before.

The standard Bubble app page URL structure is: mysite.com/my-page/my-thing

my-thing can either be the slug (if it has one) or the unique ID

So just make sure you use the correct URL structure to load the data on the dynamic page (for an actual existing invoice, assuming invoice is the page’s content type) - then run the debugger on the elements you’re having trouble with to see where you’re not loading/accessing the data correctly.

If you want to share a link to the editor, I can take a quick look, it might be easier…

Thanks for the info Adam. Once I’ve created an invoice I see this;
https://leapfroginvoice.com/version-test/html-invoice?debug_mode=true

Thanks for offering to take a look, here’s the link:

Yeah, that’s because you’re not sending the invoice to the page correctly in your workflow

You need to refer to the previous step in the workflow in order to send the newly created invoice (or at least save it somewhere on the page in order to refer to it).

So in step one create the invoice, then the final step refer to the result of step one either as the data to send or, as you’re using a custom event, as a custom state value somewhere (or set it as an element’s data). Then you can refer to that in as your data to send.

Ok I think I understand, thanks Adam! I will look at this now.

1 Like

This is the ‘Save invoice’ button which should send data to the html-invoice page. How do I refer to the result of step one? I mean literally what button do I press to get a ‘refer to’ option? Sorry about this!