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?
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’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.
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.
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!
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.
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…
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.
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!